New-style FFS class that implements support for gettext file format.
More...
New-style FFS class that implements support for gettext file format.
Definition at line 20 of file GettextFFS.php.
◆ chainGetter()
static GettextFFS::chainGetter |
( |
| $key, |
|
|
| $a, |
|
|
| $b, |
|
|
| $default ) |
|
staticprotected |
- Parameters
-
string | $key | |
array | $a | |
array | $b | |
mixed | $default | |
- Returns
- mixed
Definition at line 567 of file GettextFFS.php.
◆ doAuthors()
◆ doGettextHeader()
◆ escape()
static GettextFFS::escape |
( |
| $line | ) |
|
|
staticprotected |
◆ expectKeyword()
static GettextFFS::expectKeyword |
( |
| $name, |
|
|
| $section ) |
|
static |
◆ formatDocumentation()
GettextFFS::formatDocumentation |
( |
| $key | ) |
|
|
protected |
◆ formatForWiki()
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.
- Parameters
-
string | $data | |
string | $whitespace | |
- Exceptions
-
- Returns
- string
Definition at line 358 of file GettextFFS.php.
◆ formatMessageBlock()
GettextFFS::formatMessageBlock |
( |
| $key, |
|
|
| $m, |
|
|
| $trans, |
|
|
| $pot, |
|
|
| $pluralCount ) |
|
protected |
- Parameters
-
string | $key | |
TMessage | $m | |
array | $trans | |
array | $pot | |
int | $pluralCount | |
- Returns
- string
Definition at line 497 of file GettextFFS.php.
◆ formatTime()
static GettextFFS::formatTime |
( |
| $time | ) |
|
|
staticprotected |
◆ generateKeyFromItem()
static GettextFFS::generateKeyFromItem |
( |
array | $item, |
|
|
| $algorithm = 'simple' ) |
|
static |
Generates unique key for each message.
Changing this WILL BREAK ALL existing pages!
- Parameters
-
array | $item | As returned by parseGettextSection |
string | $algorithm | Algorithm used to generate message keys: simple or legacy |
- Returns
- string
Definition at line 319 of file GettextFFS.php.
◆ getExtraSchema()
static GettextFFS::getExtraSchema |
( |
| ) |
|
|
static |
Return a data structure that will be merged with the base schema.
It is not possible to remove things.
- Returns
- array
Implements MetaYamlSchemaExtender.
Definition at line 633 of file GettextFFS.php.
◆ getFileExtensions()
GettextFFS::getFileExtensions |
( |
| ) |
|
Return the commonly used file extensions for these formats.
Include the dot.
- Returns
- string[]
- Since
- 2013-04
Reimplemented from SimpleFFS.
Definition at line 28 of file GettextFFS.php.
◆ getGenerator()
GettextFFS::getGenerator |
( |
| ) |
|
|
protected |
◆ getPotTime()
GettextFFS::getPotTime |
( |
| ) |
|
|
protected |
◆ isContentEqual()
GettextFFS::isContentEqual |
( |
| $a, |
|
|
| $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.
- Parameters
-
- Returns
- bool
- Since
- 2016.11
Reimplemented from SimpleFFS.
Definition at line 660 of file GettextFFS.php.
◆ parseFlags()
static GettextFFS::parseFlags |
( |
| $section | ) |
|
|
static |
◆ parseGettext()
GettextFFS::parseGettext |
( |
| $data | ) |
|
◆ parseGettextData()
static GettextFFS::parseGettextData |
( |
| $data, |
|
|
| $useCtxtAsKey, |
|
|
StringMangler | $mangler, |
|
|
| $keyAlgorithm, |
|
|
bool | $allowPotMode ) |
|
static |
Parses gettext file as string into internal representation.
- Parameters
-
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 |
bool | $allowPotMode | |
- Exceptions
-
- Returns
- array
Definition at line 95 of file GettextFFS.php.
◆ parseGettextSection()
static GettextFFS::parseGettextSection |
( |
| $section, |
|
|
| $pluralCount ) |
|
static |
◆ parseHeaderTags()
static GettextFFS::parseHeaderTags |
( |
| $headers | ) |
|
|
static |
◆ processGettextPluralMessage()
static GettextFFS::processGettextPluralMessage |
( |
| $pluralCount, |
|
|
| $section ) |
|
static |
◆ read()
GettextFFS::read |
( |
| $code | ) |
|
◆ readFromVariable()
GettextFFS::readFromVariable |
( |
| $data | ) |
|
◆ setOfflineMode()
GettextFFS::setOfflineMode |
( |
| $value | ) |
|
◆ shouldOverwrite()
GettextFFS::shouldOverwrite |
( |
| $a, |
|
|
| $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.
- Parameters
-
string | $a | The existing content. |
string | $b | The new export content. |
- Returns
- bool
- Since
- 2017.04
Reimplemented from SimpleFFS.
Definition at line 624 of file GettextFFS.php.
◆ supportsFuzzy()
GettextFFS::supportsFuzzy |
( |
| ) |
|
Query the capabilities of this FFS.
Allowed values are:
- yes
- write (ignored on read)
- no (stripped on write)
- Returns
- string
- Since
- 2013-03-05
Reimplemented from SimpleFFS.
Definition at line 24 of file GettextFFS.php.
◆ writeReal()
◆ $offlineMode
GettextFFS::$offlineMode = false |
|
protected |
The documentation for this class was generated from the following file: