ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Public Member Functions | |
loadTranslations ($translations) | |
Loads translation from a Translations instance, a file on an array. More... | |
gettext ($original) | |
ngettext ($original, $plural, $value) | |
dngettext ($domain, $original, $plural, $value) | |
npgettext ($context, $original, $plural, $value) | |
pgettext ($context, $original) | |
dgettext ($domain, $original) | |
dpgettext ($domain, $context, $original) | |
dnpgettext ($domain, $context, $original, $plural, $value) | |
Public Member Functions inherited from Gettext\BaseTranslator | |
register () | |
Protected Member Functions | |
addTranslations (array $translations) | |
Set new translations to the dictionary. More... | |
getTranslation ($domain, $context, $original) | |
Search and returns a translation. More... | |
isPlural ($domain, $n) | |
Executes the plural decision code given the number to decide which plural version to take. More... | |
Static Private Member Functions | |
static | fixTerseIfs ($code, $inner=false) |
This function will recursively wrap failure states in brackets if they contain a nested terse if. More... | |
Private Attributes | |
$domain | |
$dictionary = array() | |
$context_glue = "\004" | |
$plurals = array() | |
Additional Inherited Members | |
Static Public Member Functions inherited from Gettext\BaseTranslator | |
static | initGettextFunctions (TranslatorInterface $translator) |
Set a translation instance as global, to use it with the gettext functions. More... | |
Static Public Attributes inherited from Gettext\BaseTranslator | |
static | $current |
Definition at line 7 of file Translator.php.
|
protected |
Set new translations to the dictionary.
array | $translations |
Definition at line 136 of file Translator.php.
Gettext\Translator::dgettext | ( | $domain, | |
$original | |||
) |
{Gets a translation checking the domain.
string | $domain | |
string | $original |
Implements Gettext\TranslatorInterface.
Definition at line 93 of file Translator.php.
References $domain.
Gettext\Translator::dngettext | ( | $domain, | |
$original, | |||
$plural, | |||
$value | |||
) |
{Gets a translation checking the domain and the plural form.
string | $domain | |
string | $original | |
string | $plural | |
string | $value |
Implements Gettext\TranslatorInterface.
Definition at line 63 of file Translator.php.
References $domain.
Gettext\Translator::dnpgettext | ( | $domain, | |
$context, | |||
$original, | |||
$plural, | |||
$value | |||
) |
{Gets a translation checking the domain, the context and the plural form.
string | $domain | |
string | $context | |
string | $original | |
string | $plural | |
string | $value |
Implements Gettext\TranslatorInterface.
Definition at line 119 of file Translator.php.
Gettext\Translator::dpgettext | ( | $domain, | |
$context, | |||
$original | |||
) |
{Gets a translation checking the domain and context.
string | $domain | |
string | $context | |
string | $original |
Implements Gettext\TranslatorInterface.
Definition at line 103 of file Translator.php.
References $domain.
|
staticprivate |
This function will recursively wrap failure states in brackets if they contain a nested terse if.
This because PHP can not handle nested terse if's unless they are wrapped in brackets.
This code probably only works for the gettext plural decision codes.
return ($n==1 ? 0 : $n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20) ? 1 : 2); becomes return ($n==1 ? 0 : ($n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20) ? 1 : 2));
string | $code | the terse if string |
bool | $inner | If inner is true we wrap it in brackets |
Definition at line 228 of file Translator.php.
References $code, $failure, and $success.
Gettext\Translator::gettext | ( | $original | ) |
{Gets a translation using the original string.
string | $original |
Implements Gettext\TranslatorInterface.
Definition at line 43 of file Translator.php.
|
protected |
Search and returns a translation.
string | $domain | |
string | $context | |
string | $original |
Definition at line 176 of file Translator.php.
|
protected |
Executes the plural decision code given the number to decide which plural version to take.
string | $domain | |
string | $n |
Definition at line 192 of file Translator.php.
Gettext\Translator::loadTranslations | ( | $translations | ) |
Loads translation from a Translations instance, a file on an array.
Translations | string | array | $translations |
Definition at line 21 of file Translator.php.
References ILIAS\UI\Implementation\Component\toArray().
Gettext\Translator::ngettext | ( | $original, | |
$plural, | |||
$value | |||
) |
{Gets a translation checking the plural form.
string | $original | |
string | $plural | |
string | $value |
Implements Gettext\TranslatorInterface.
Definition at line 53 of file Translator.php.
Gettext\Translator::npgettext | ( | $context, | |
$original, | |||
$plural, | |||
$value | |||
) |
{Gets a translation checking the context and the plural form.
string | $context | |
string | $original | |
string | $plural | |
string | $value |
Implements Gettext\TranslatorInterface.
Definition at line 73 of file Translator.php.
Gettext\Translator::pgettext | ( | $context, | |
$original | |||
) |
{Gets a translation checking the context.
string | $context | |
string | $original |
Implements Gettext\TranslatorInterface.
Definition at line 83 of file Translator.php.
|
private |
Definition at line 11 of file Translator.php.
|
private |
Definition at line 10 of file Translator.php.
|
private |
Definition at line 9 of file Translator.php.
|
private |
Definition at line 12 of file Translator.php.