New-style FFS 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 ($value) | |
readFromVariable ($data) | |
Parse the message data given as a string in the SimpleFFS format and return it as an array of AUTHORS and MESSAGES. | |
parseGettext ($data) | |
Static Public Member Functions | |
static | parseGettextData ($data, $useCtxtAsKey, $mangler, $keyAlgorithm) |
Parses gettext file as string into internal representation. | |
static | parseGettextSection ($section, $pluralCount, &$metadata) |
static | processGettextPluralMessage ($pluralCount, $section) |
static | parseFlags ($section) |
static | expectKeyword ($name, $section) |
static | generateKeyFromItem (array $item, $algorithm= 'legacy') |
Generates unique key for each message. | |
static | formatForWiki ($data, $whitespace= 'mark') |
This parses the Gettext text block format. | |
static | parseHeaderTags ($headers) |
static | getPluralRule ($code) |
Returns plural rule for Gettext. | |
Protected Member Functions | |
writeReal (MessageCollection $collection) | |
doGettextHeader (MessageCollection $collection, $template, &$pluralCount) | |
doAuthors (MessageCollection $collection) | |
formatMessageBlock ($key, $m, $trans, $pot, $pluralCount) | |
getPotTime () | |
getGenerator () | |
formatDocumentation ($key) | |
splitPlural ($text, $forms) | |
Static Protected Member Functions | |
static | chainGetter ($key, $a, $b, $default) |
static | formatTime ($time) |
static | escape ($line) |
Protected Attributes | |
$offlineMode = false |
New-style FFS class that implements support for gettext file format.
Definition at line 22 of file GettextFFS.php.
static GettextFFS::chainGetter | ( | $ | key, | |
$ | a, | |||
$ | b, | |||
$ | default | |||
) | [static, protected] |
Definition at line 526 of file GettextFFS.php.
Referenced by formatMessageBlock().
GettextFFS::doAuthors | ( | MessageCollection $ | collection | ) | [protected] |
Definition at line 451 of file GettextFFS.php.
Referenced by doGettextHeader().
GettextFFS::doGettextHeader | ( | MessageCollection $ | collection, | |
$ | template, | |||
&$ | pluralCount | |||
) | [protected] |
Definition at line 384 of file GettextFFS.php.
Referenced by writeReal().
static GettextFFS::escape | ( | $ | line | ) | [static, protected] |
Definition at line 579 of file GettextFFS.php.
Referenced by doGettextHeader(), and formatMessageBlock().
static GettextFFS::expectKeyword | ( | $ | name, | |
$ | section | |||
) | [static] |
Definition at line 274 of file GettextFFS.php.
Referenced by parseGettextData(), parseGettextSection(), and processGettextPluralMessage().
GettextFFS::formatDocumentation | ( | $ | key | ) | [protected] |
Definition at line 553 of file GettextFFS.php.
Referenced by formatMessageBlock().
static GettextFFS::formatForWiki | ( | $ | data, | |
$ | whitespace = 'mark' | |||
) | [static] |
This parses the Gettext text block format.
Since trailing whitespace is not allowed in MediaWiki pages, the default action is to append \-character at the end of the message. You can also choose to ignore it and use the trim action instead.
$data | ||
$whitespace | string |
MWException |
Definition at line 334 of file GettextFFS.php.
Referenced by parseGettextData(), parseGettextSection(), and processGettextPluralMessage().
GettextFFS::formatMessageBlock | ( | $ | key, | |
$ | m, | |||
$ | trans, | |||
$ | pot, | |||
$ | pluralCount | |||
) | [protected] |
Definition at line 463 of file GettextFFS.php.
Referenced by writeReal().
static GettextFFS::formatTime | ( | $ | time | ) | [static, protected] |
Definition at line 536 of file GettextFFS.php.
Referenced by doGettextHeader().
static GettextFFS::generateKeyFromItem | ( | array $ | item, | |
$ | algorithm = 'legacy' | |||
) | [static] |
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 295 of file GettextFFS.php.
Referenced by parseGettextData(), GettextFFSTest::testHashing(), and GettextFFSTest::testMangling().
GettextFFS::getFileExtensions | ( | ) |
Return the commonly used file extensions for these formats.
Include the dot.
Reimplemented from SimpleFFS.
Definition at line 27 of file GettextFFS.php.
GettextFFS::getGenerator | ( | ) | [protected] |
Definition at line 548 of file GettextFFS.php.
Referenced by doGettextHeader().
static GettextFFS::getPluralRule | ( | $ | code | ) | [static] |
Returns plural rule for Gettext.
$code | String Language code. |
Definition at line 594 of file GettextFFS.php.
Referenced by doGettextHeader().
GettextFFS::getPotTime | ( | ) | [protected] |
Definition at line 542 of file GettextFFS.php.
Referenced by doGettextHeader().
static GettextFFS::parseFlags | ( | $ | section | ) | [static] |
Definition at line 265 of file GettextFFS.php.
Referenced by parseGettextData(), and parseGettextSection().
GettextFFS::parseGettext | ( | $ | data | ) |
Definition at line 59 of file GettextFFS.php.
Referenced by readFromVariable().
static GettextFFS::parseGettextData | ( | $ | data, | |
$ | useCtxtAsKey, | |||
$ | mangler, | |||
$ | keyAlgorithm | |||
) | [static] |
Parses gettext file as string into internal representation.
string | $data | |
bool | $useCtxtAsKey Whether to create message keys from the context or use msgctxt (non-standard po-files) | |
StringMangler | $mangler | |
string | $keyAlgorithm Key generation algorithm, see generateKeyFromItem |
MWException |
Definition at line 80 of file GettextFFS.php.
Referenced by parseGettext().
static GettextFFS::parseGettextSection | ( | $ | section, | |
$ | pluralCount, | |||
&$ | metadata | |||
) | [static] |
Definition at line 163 of file GettextFFS.php.
Referenced by parseGettextData().
static GettextFFS::parseHeaderTags | ( | $ | headers | ) | [static] |
Definition at line 353 of file GettextFFS.php.
Referenced by parseGettextData().
static GettextFFS::processGettextPluralMessage | ( | $ | pluralCount, | |
$ | section | |||
) | [static] |
Definition at line 244 of file GettextFFS.php.
Referenced by parseGettextSection().
GettextFFS::readFromVariable | ( | $ | data | ) |
Parse the message data given as a string in the SimpleFFS format and return it as an array of AUTHORS and MESSAGES.
$data | string |
MWException |
Reimplemented from SimpleFFS.
Definition at line 40 of file GettextFFS.php.
GettextFFS::setOfflineMode | ( | $ | value | ) |
$value | bool |
Definition at line 36 of file GettextFFS.php.
GettextFFS::splitPlural | ( | $ | text, | |
$ | forms | |||
) | [protected] |
Definition at line 610 of file GettextFFS.php.
Referenced by formatMessageBlock().
GettextFFS::supportsFuzzy | ( | ) |
Query the capabilities of this FFS.
Allowed values are:
Reimplemented from SimpleFFS.
Definition at line 23 of file GettextFFS.php.
GettextFFS::writeReal | ( | MessageCollection $ | collection | ) | [protected] |
$collection | MessageCollection |
Reimplemented from SimpleFFS.
Definition at line 366 of file GettextFFS.php.
GettextFFS::$offlineMode = false [protected] |
Definition at line 31 of file GettextFFS.php.