Flattens message arrays for further processing. More...
Public Member Functions | |
__construct (string $sep='.', bool $parseCLDRPlurals=false) | |
flatten (array $unflat) | |
Flattens multidimensional array. | |
flattenCLDRPlurals (array $messages) | |
Flattens arrays that contain CLDR plural keywords into single values using MediaWiki's plural syntax. | |
unflatten (array $flat) | |
Performs the reverse operation of flatten. | |
unflattenCLDRPlurals (string $key, string $message) | |
Converts the plural syntax to array of CLDR style plurals. | |
compareContent (string $a, string $b) | |
Compares two strings for equal content, taking PLURAL expansion into account. | |
Protected Attributes | |
$sep | |
$parseCLDRPlurals | |
Static Protected Attributes | |
static | $pluralWords |
Flattens message arrays for further processing.
Supports parsing CLDR plural messages and converting them into MediaWiki's {{PLURAL}} syntax in a single message.
Definition at line 19 of file ArrayFlattener.php.
MediaWiki\Extension\Translate\MessageProcessing\ArrayFlattener::__construct | ( | string | $sep = '.', |
bool | $parseCLDRPlurals = false ) |
Definition at line 34 of file ArrayFlattener.php.
MediaWiki\Extension\Translate\MessageProcessing\ArrayFlattener::compareContent | ( | string | $a, |
string | $b ) |
Compares two strings for equal content, taking PLURAL expansion into account.
Definition at line 272 of file ArrayFlattener.php.
MediaWiki\Extension\Translate\MessageProcessing\ArrayFlattener::flatten | ( | array | $unflat | ) |
Flattens multidimensional array.
array | $unflat | Array of messages |
Definition at line 43 of file ArrayFlattener.php.
MediaWiki\Extension\Translate\MessageProcessing\ArrayFlattener::flattenCLDRPlurals | ( | array | $messages | ) |
Flattens arrays that contain CLDR plural keywords into single values using MediaWiki's plural syntax.
MWException |
Definition at line 81 of file ArrayFlattener.php.
MediaWiki\Extension\Translate\MessageProcessing\ArrayFlattener::unflatten | ( | array | $flat | ) |
Performs the reverse operation of flatten.
array | $flat | Array of messages |
Definition at line 134 of file ArrayFlattener.php.
MediaWiki\Extension\Translate\MessageProcessing\ArrayFlattener::unflattenCLDRPlurals | ( | string | $key, |
string | $message ) |
Converts the plural syntax to array of CLDR style plurals.
Definition at line 189 of file ArrayFlattener.php.
|
protected |
Definition at line 23 of file ArrayFlattener.php.
|
staticprotected |
Definition at line 25 of file ArrayFlattener.php.
|
protected |
Definition at line 21 of file ArrayFlattener.php.