ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Main class to convert the plural rules of a language from CLDR to gettext. More...
Public Member Functions | |
getUSAsciiClone () | |
Returns a clone of this instance with all the strings to US-ASCII. More... | |
Static Public Member Functions | |
static | getAll () |
Return a list of all languages available. More... | |
static | getById ($id) |
Return a Language instance given the language id. More... | |
Data Fields | |
$id | |
$name | |
$supersededBy | |
$script | |
$territory | |
$baseLanguage | |
$categories | |
$formula | |
Private Member Functions | |
__construct ($info) | |
Initialize the instance and parse the language code. More... | |
checkAlwaysTrueCategories () | |
Let's look for categories that will always occur. More... | |
checkAlwaysFalseCategories () | |
Let's look for categories that will never occur. More... | |
checkAllCategoriesWithExamples () | |
Let's look for categories that don't have examples. More... | |
buildFormula () | |
Build the formula starting from the currently defined categories. More... | |
Static Private Member Functions | |
static | reverseFormula ($formula) |
Reverse a formula. More... | |
static | reduceFormula ($formula) |
Reduce some excessively complex formulas. More... | |
static | asciifier (&$value) |
Take one variable and, if it's a string, we transliterate it to US-ASCII. More... | |
Main class to convert the plural rules of a language from CLDR to gettext.
Definition at line 9 of file Language.php.
|
private |
Initialize the instance and parse the language code.
array | $info | The result of CldrData::getLanguageInfo() |
Exception | Throws an Exception if $fullId is not valid. |
Definition at line 56 of file Language.php.
References Gettext\Languages\CldrData\$categories, $info, array, Gettext\Languages\Language\buildFormula(), Gettext\Languages\Language\checkAllCategoriesWithExamples(), Gettext\Languages\Language\checkAlwaysFalseCategories(), Gettext\Languages\Language\checkAlwaysTrueCategories(), and Gettext\Languages\CldrData\OTHER_CATEGORY.
|
staticprivate |
Take one variable and, if it's a string, we transliterate it to US-ASCII.
mixed | $value | The variable to work on. |
Exception |
Definition at line 322 of file Language.php.
References array.
|
private |
Build the formula starting from the currently defined categories.
Definition at line 249 of file Language.php.
References Gettext\Languages\Language\$formula, and $i.
Referenced by Gettext\Languages\Language\__construct(), and Gettext\Languages\Language\checkAllCategoriesWithExamples().
|
private |
Let's look for categories that don't have examples.
This because with decimals (CLDR) we may have more cases, with integers (gettext) we have some less cases. If we found those categories, we check that they never occur and we strip them out.
Exception |
Definition at line 174 of file Language.php.
References array, Gettext\Languages\Language\buildFormula(), and Gettext\Languages\CldrData\OTHER_CATEGORY.
Referenced by Gettext\Languages\Language\__construct().
|
private |
Let's look for categories that will never occur.
This because with decimals (CLDR) we may have more cases, with integers (gettext) we have some less cases. If we found those categories we strip them out.
Definition at line 154 of file Language.php.
References array.
Referenced by Gettext\Languages\Language\__construct().
|
private |
Let's look for categories that will always occur.
This because with decimals (CLDR) we may have more cases, with integers (gettext) we have just one case. If we found that (single) category we reduce the categories to that one only.
Definition at line 126 of file Language.php.
References array, and Gettext\Languages\CldrData\OTHER_CATEGORY.
Referenced by Gettext\Languages\Language\__construct().
|
static |
Return a list of all languages available.
Exception |
Definition at line 96 of file Language.php.
References $result, array, Gettext\Languages\CldrData\getLanguageInfo(), and Gettext\Languages\CldrData\getLanguageNames().
|
static |
Return a Language instance given the language id.
string | $id |
Definition at line 110 of file Language.php.
References Gettext\Languages\Language\$id, $info, $result, and Gettext\Languages\CldrData\getLanguageInfo().
Gettext\Languages\Language::getUSAsciiClone | ( | ) |
Returns a clone of this instance with all the strings to US-ASCII.
Definition at line 352 of file Language.php.
References array.
|
staticprivate |
Reduce some excessively complex formulas.
string | $formula |
Definition at line 308 of file Language.php.
References Gettext\Languages\Language\$formula, and array.
|
staticprivate |
Reverse a formula.
string | $formula |
Exception |
Definition at line 280 of file Language.php.
References Gettext\Languages\Language\$formula, $m, and array.
Gettext\Languages\Language::$baseLanguage |
Definition at line 40 of file Language.php.
Gettext\Languages\Language::$categories |
Definition at line 45 of file Language.php.
Gettext\Languages\Language::$formula |
Definition at line 50 of file Language.php.
Referenced by Gettext\Languages\Language\buildFormula(), Gettext\Languages\Language\reduceFormula(), and Gettext\Languages\Language\reverseFormula().
Gettext\Languages\Language::$id |
Definition at line 15 of file Language.php.
Referenced by Gettext\Languages\Language\getById().
Gettext\Languages\Language::$name |
Definition at line 20 of file Language.php.
Gettext\Languages\Language::$script |
Definition at line 30 of file Language.php.
Gettext\Languages\Language::$supersededBy |
Definition at line 25 of file Language.php.
Gettext\Languages\Language::$territory |
Definition at line 35 of file Language.php.