Implements support for message storage in YAML format. More...
Public Member Functions | |
__construct (FileBasedMessageGroup $group) | |
getFileExtensions () | |
Return the commonly used file extensions for these formats. | |
readFromVariable (string $data) | |
@inheritDoc | |
isContentEqual (?string $a, ?string $b) | |
Checks whether two strings are equal. | |
![]() | |
supportsFuzzy () | |
Query the capabilities of this FFS. | |
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. | |
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. | |
Protected Member Functions | |
writeReal (MessageCollection $collection) | |
![]() | |
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 | |
![]() | |
FileBasedMessageGroup | $group |
string | $writePath = null |
$extra | |
Implements support for message storage in YAML format.
This class adds new key into FILES section: codeAsRoot
. If it is set to true, all messages will under language code.
Definition at line 21 of file YamlFormat.php.
MediaWiki\Extension\Translate\FileFormatSupport\YamlFormat::__construct | ( | FileBasedMessageGroup | $group | ) |
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 24 of file YamlFormat.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 136 of file YamlFormat.php.
MediaWiki\Extension\Translate\FileFormatSupport\YamlFormat::getFileExtensions | ( | ) |
Return the commonly used file extensions for these formats.
Include the dot.
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 35 of file YamlFormat.php.
MediaWiki\Extension\Translate\FileFormatSupport\YamlFormat::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.
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 132 of file YamlFormat.php.
MediaWiki\Extension\Translate\FileFormatSupport\YamlFormat::readFromVariable | ( | string | $data | ) |
@inheritDoc
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 40 of file YamlFormat.php.
|
protected |
Reimplemented from MediaWiki\Extension\Translate\FileFormatSupport\SimpleFormat.
Definition at line 66 of file YamlFormat.php.