Public Member Functions | |
__construct (FileBasedMessageGroup $group) | |
setWritePath (string $target) | |
Set the file's location in the system. | |
getWritePath () | |
Get the file's location in the system. | |
read (string $code) | |
Will parse messages, authors, and any custom data from the file and return it in associative array with keys like AUTHORS and MESSAGES . | |
readFromVariable (string $data) | |
Same as read(), but takes the data as a parameter. | |
write (MessageCollection $collection) | |
Writes to the location provided with setWritePath and group specific directory structure. | |
writeIntoVariable (MessageCollection $collection) | |
Quick shortcut for getting the plain exported data. | |
supportsFuzzy () | |
Query the capabilities of this FFS. | |
isContentEqual (?string $a, ?string $b) | |
Checks whether two strings are equal. | |
getFileExtensions () | |
Return the commonly used file extensions for these formats. | |
shouldOverwrite (string $a, string $b) | |
Allows to skip writing the export output into a file. | |
Definition at line 19 of file FileFormatSupport.php.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport::getFileExtensions | ( | ) |
Return the commonly used file extensions for these formats.
Include the dot.
Implemented in MediaWiki\Extension\Translate\FileFormatSupport\AmdFormat, MediaWiki\Extension\Translate\FileFormatSupport\AndroidXmlFormat, MediaWiki\Extension\Translate\FileFormatSupport\AppleFormat, MediaWiki\Extension\Translate\FileFormatSupport\DtdFormat, MediaWiki\Extension\Translate\FileFormatSupport\GettextFormat, MediaWiki\Extension\Translate\FileFormatSupport\IniFormat, MediaWiki\Extension\Translate\FileFormatSupport\JavaFormat, MediaWiki\Extension\Translate\FileFormatSupport\JsonFormat, MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat, and MediaWiki\Extension\Translate\FileFormatSupport\YamlFormat.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport::getWritePath | ( | ) |
Get the file's location in the system.
Implemented in MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport::isContentEqual | ( | ?string | $a, |
?string | $b ) |
Checks whether two strings are equal.
Sometimes same content might have multiple representations. The main case are inline plurals, which in some formats require expansion at export time.
Implemented in MediaWiki\Extension\Translate\FileFormatSupport\AndroidXmlFormat, MediaWiki\Extension\Translate\FileFormatSupport\JsonFormat, MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat, and MediaWiki\Extension\Translate\FileFormatSupport\YamlFormat.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport::read | ( | string | $code | ) |
Will parse messages, authors, and any custom data from the file and return it in associative array with keys like AUTHORS
and MESSAGES
.
string | $code | Language code. |
Implemented in MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport::readFromVariable | ( | string | $data | ) |
Same as read(), but takes the data as a parameter.
The caller is supposed to know in what language the translations are.
string | $data | Formatted messages. |
Implemented in MediaWiki\Extension\Translate\FileFormatSupport\AmdFormat, MediaWiki\Extension\Translate\FileFormatSupport\AndroidXmlFormat, MediaWiki\Extension\Translate\FileFormatSupport\AppleFormat, MediaWiki\Extension\Translate\FileFormatSupport\DtdFormat, MediaWiki\Extension\Translate\FileFormatSupport\GettextFormat, MediaWiki\Extension\Translate\FileFormatSupport\IniFormat, MediaWiki\Extension\Translate\FileFormatSupport\JavaFormat, MediaWiki\Extension\Translate\FileFormatSupport\JsonFormat, MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat, and MediaWiki\Extension\Translate\FileFormatSupport\YamlFormat.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport::setWritePath | ( | string | $target | ) |
Set the file's location in the system.
string | $target | Filesystem path for exported files. |
Implemented in MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport::shouldOverwrite | ( | string | $a, |
string | $b ) |
Allows to skip writing the export output into a file.
This is useful to skip updates that would only update irrelevant parts, such as the timestamp of the export.
string | $a | The existing content. |
string | $b | The new export content. |
Implemented in MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport::supportsFuzzy | ( | ) |
Query the capabilities of this FFS.
Allowed values are:
Implemented in MediaWiki\Extension\Translate\FileFormatSupport\AndroidXmlFormat, MediaWiki\Extension\Translate\FileFormatSupport\AppleFormat, MediaWiki\Extension\Translate\FileFormatSupport\GettextFormat, MediaWiki\Extension\Translate\FileFormatSupport\IniFormat, MediaWiki\Extension\Translate\FileFormatSupport\JavaFormat, and MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport::write | ( | MessageCollection | $collection | ) |
Writes to the location provided with setWritePath and group specific directory structure.
Exports translations included in the given collection with any special handling needed.
Implemented in MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
MediaWiki\Extension\Translate\FileFormatSupport\FileFormatSupport::writeIntoVariable | ( | MessageCollection | $collection | ) |
Quick shortcut for getting the plain exported data.
Same as write(), but returns the output instead of writing it into a file.
Implemented in MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.