JavaFormat class implements support for Java properties files. More...
Public Member Functions | |
| __construct (FileBasedMessageGroup $group) | |
| supportsFuzzy () | |
| Query the capabilities of this FFS. | |
| getFileExtensions () | |
| Return the commonly used file extensions for these formats. | |
| readFromVariable (string $data) | |
| writeRow (string $key, string $value) | |
| Writes well-formed properties file row with key and value. | |
| readRow (string $line, string $sep) | |
| Parses non-empty properties file row to key and value. | |
Public Member Functions inherited from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat | |
| setGroup (FileBasedMessageGroup $group) | |
| getGroup () | |
| setWritePath (string $target) | |
| Set the file's location in the system. | |
| getWritePath () | |
| Get the file's location in the system. | |
| exists ( $code=false) | |
| Returns true if the file for this message group in a given language exists. | |
| read (string $languageCode) | |
| Reads messages from the file in a given language and returns an array of AUTHORS, MESSAGES and possibly other properties. | |
| write (MessageCollection $collection) | |
| Write the collection to file. | |
| writeIntoVariable (MessageCollection $collection) | |
| Read a collection and return it as a SimpleFormat formatted string. | |
| filterAuthors (array $authors, string $code) | |
| Remove excluded authors. | |
| isContentEqual (?string $a, ?string $b) | |
| Checks whether two strings are equal. | |
| shouldOverwrite (string $a, string $b) | |
| Allows to skip writing the export output into a file. | |
| isGroupFfsReadable () | |
| Check if the file format of the current group is readable by the file format system. | |
Static Public Member Functions | |
| static | getExtraSchema () |
| Return a data structure that will be merged with the base schema. | |
Public Attributes | |
| $messages = $this->group->getMangler()->mangleArray( $messages ) | |
| return ['AUTHORS'=> $authors, 'MESSAGES'=> $messages,] | |
Protected Member Functions | |
| writeReal (MessageCollection $collection) | |
Protected Member Functions inherited from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat | |
| tryReadSource (string $filename, MessageCollection $collection) | |
| This tries to pick up external authors in the source files so that they are not lost if those authors are not among those who have translated in the wiki. | |
| tryReadFile (string $filename) | |
| Read the contents of $filename and return it as a string. | |
Additional Inherited Members | |
Protected Attributes inherited from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat | |
| FileBasedMessageGroup | $group |
| string | $writePath = null |
| $extra | |
JavaFormat class implements support for Java properties files.
This class reads and writes only utf-8 files. Java projects need to run native2ascii on them before using them.
This class adds a new item into FILES section of group configuration: keySeparator which defaults to '='.
Definition at line 23 of file JavaFormat.php.
| MediaWiki\Extension\Translate\FileFormatSupport\JavaFormat::__construct | ( | FileBasedMessageGroup | $group | ) |
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 27 of file JavaFormat.php.
|
static |
Return a data structure that will be merged with the base schema.
It is not possible to remove things.
Implements MediaWiki\Extension\Translate\MessageGroupConfiguration\MetaYamlSchemaExtender.
Definition at line 221 of file JavaFormat.php.
| MediaWiki\Extension\Translate\FileFormatSupport\JavaFormat::getFileExtensions | ( | ) |
Return the commonly used file extensions for these formats.
Include the dot.
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 36 of file JavaFormat.php.
| MediaWiki\Extension\Translate\FileFormatSupport\JavaFormat::readFromVariable | ( | string | $data | ) |
| RuntimeException |
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 41 of file JavaFormat.php.
| MediaWiki\Extension\Translate\FileFormatSupport\JavaFormat::readRow | ( | string | $line, |
| string | $sep ) |
Parses non-empty properties file row to key and value.
Definition at line 140 of file JavaFormat.php.
| MediaWiki\Extension\Translate\FileFormatSupport\JavaFormat::supportsFuzzy | ( | ) |
Query the capabilities of this FFS.
Allowed values are:
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 32 of file JavaFormat.php.
|
protected |
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 92 of file JavaFormat.php.
| MediaWiki\Extension\Translate\FileFormatSupport\JavaFormat::writeRow | ( | string | $key, |
| string | $value ) |
Writes well-formed properties file row with key and value.
Definition at line 125 of file JavaFormat.php.
| MediaWiki\Extension\Translate\FileFormatSupport\JavaFormat::$messages = $this->group->getMangler()->mangleArray( $messages ) |
Definition at line 84 of file JavaFormat.php.
| MediaWiki\Extension\Translate\FileFormatSupport\JavaFormat::return[ 'AUTHORS'=> $authors, 'MESSAGES'=> $messages,] |
Definition at line 86 of file JavaFormat.php.