FileFormat class that implements support for gettext file format. More...
Public Member Functions | |
supportsFuzzy () | |
Query the capabilities of this FFS. | |
getFileExtensions () | |
Return the commonly used file extensions for these formats. | |
setOfflineMode (bool $value) | |
read ( $languageCode) | |
@inheritDoc | |
readFromVariable (string $data) | |
Parse the message data given as a string in the SimpleFormat format and return it as an array of AUTHORS and MESSAGES. | |
generateKeyFromItem (array $item, string $algorithm='simple') | |
Generates unique key for each message. | |
Public Member Functions inherited from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat | |
__construct (FileBasedMessageGroup $group) | |
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. | |
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 | |
Static Public Member Functions inherited from MediaWiki\Extension\Translate\MessageGroupConfiguration\MetaYamlSchemaExtender | |
static | getExtraSchema () |
Return a data structure that will be merged with the base schema. | |
Protected Attributes inherited from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat | |
FileBasedMessageGroup | $group |
string | $writePath = null |
$extra | |
FileFormat class that implements support for gettext file format.
Definition at line 29 of file GettextFormat.php.
MediaWiki\Extension\Translate\FileFormatSupport\GettextFormat::generateKeyFromItem | ( | array | $item, |
string | $algorithm = 'simple' ) |
Generates unique key for each message.
Changing this WILL BREAK ALL existing pages!
array | $item | As returned by parseGettextSection |
string | $algorithm | Algorithm used to generate message keys: simple or legacy |
Definition at line 301 of file GettextFormat.php.
MediaWiki\Extension\Translate\FileFormatSupport\GettextFormat::getFileExtensions | ( | ) |
Return the commonly used file extensions for these formats.
Include the dot.
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 37 of file GettextFormat.php.
MediaWiki\Extension\Translate\FileFormatSupport\GettextFormat::read | ( | $languageCode | ) |
@inheritDoc
Definition at line 46 of file GettextFormat.php.
MediaWiki\Extension\Translate\FileFormatSupport\GettextFormat::readFromVariable | ( | string | $data | ) |
Parse the message data given as a string in the SimpleFormat format and return it as an array of AUTHORS and MESSAGES.
InvalidArgumentException |
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 58 of file GettextFormat.php.
MediaWiki\Extension\Translate\FileFormatSupport\GettextFormat::setOfflineMode | ( | bool | $value | ) |
Definition at line 41 of file GettextFormat.php.
MediaWiki\Extension\Translate\FileFormatSupport\GettextFormat::supportsFuzzy | ( | ) |
Query the capabilities of this FFS.
Allowed values are:
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 33 of file GettextFormat.php.
|
protected |
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 382 of file GettextFormat.php.