ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Class to manage a collection of translations. More...
Public Member Functions | |
__construct ($input=array(), $flags=0, $iterator_class='ArrayIterator') | |
__call ($name, $arguments) | |
Magic method to import/export the translations to a specific format For example: $translations->toMoFile($filename); For example: $translations->addFromMoFile($filename);. More... | |
__clone () | |
Magic method to clone each translation on clone the translations object. More... | |
offsetSet ($index, $value) | |
Control the new translations added. More... | |
setPluralForms ($count, $rule) | |
Set the plural definition. More... | |
getPluralForms () | |
Returns the parsed plural definition. More... | |
setHeader ($name, $value) | |
Set a new header. More... | |
getHeader ($name) | |
Returns a header value. More... | |
getHeaders () | |
Returns all header for this translations. More... | |
deleteHeaders () | |
Removes all headers. More... | |
deleteHeader ($name) | |
Removes one header. More... | |
getLanguage () | |
Returns the language value. More... | |
setLanguage ($language) | |
Sets the language and the plural forms. More... | |
hasLanguage () | |
Checks whether the language is empty or not. More... | |
setDomain ($domain) | |
Set a new domain for this translations. More... | |
getDomain () | |
Returns the domain. More... | |
hasDomain () | |
Checks whether the domain is empty or not. More... | |
find ($context, $original='') | |
Search for a specific translation. More... | |
insert ($context, $original, $plural='') | |
Creates and insert/merges a new translation. More... | |
mergeWith (Translations $translations, $method=null) | |
Merges this translations with other translations. More... | |
Static Public Member Functions | |
static | __callStatic ($name, $arguments) |
Magic method to create new instances using extractors For example: Translations::fromMoFile($filename);. More... | |
Data Fields | |
const | MERGE_ADD = 1 |
const | MERGE_REMOVE = 2 |
const | MERGE_HEADERS = 4 |
const | MERGE_REFERENCES = 8 |
const | MERGE_COMMENTS = 16 |
const | MERGE_LANGUAGE = 32 |
const | MERGE_PLURAL = 64 |
const | MERGE_OVERRIDE = 128 |
const | HEADER_LANGUAGE = 'Language' |
const | HEADER_PLURAL = 'Plural-Forms' |
const | HEADER_DOMAIN = 'X-Domain' |
Static Public Attributes | |
static | $mergeDefault = 93 |
Private Attributes | |
$headers | |
$translationCount | |
Class to manage a collection of translations.
Definition at line 11 of file Translations.php.
Gettext\Translations::__construct | ( | $input = array() , |
|
$flags = 0 , |
|||
$iterator_class = 'ArrayIterator' |
|||
) |
Definition at line 34 of file Translations.php.
Gettext\Translations::__call | ( | $name, | |
$arguments | |||
) |
Magic method to import/export the translations to a specific format For example: $translations->toMoFile($filename); For example: $translations->addFromMoFile($filename);.
Definition at line 73 of file Translations.php.
References $name.
|
static |
Magic method to create new instances using extractors For example: Translations::fromMoFile($filename);.
Definition at line 57 of file Translations.php.
References $name.
Gettext\Translations::__clone | ( | ) |
Magic method to clone each translation on clone the translations object.
Definition at line 95 of file Translations.php.
Gettext\Translations::deleteHeader | ( | $name | ) |
Removes one header.
string | $name |
Definition at line 222 of file Translations.php.
References $name.
Gettext\Translations::deleteHeaders | ( | ) |
Gettext\Translations::find | ( | $context, | |
$original = '' |
|||
) |
Search for a specific translation.
string | Translation | $context | The context of the translation or a translation instance |
string | $original | The original string |
Definition at line 309 of file Translations.php.
References $id.
Referenced by Gettext\Translations\mergeWith().
Gettext\Translations::getDomain | ( | ) |
Returns the domain.
Definition at line 284 of file Translations.php.
References Dflydev\FigCookies\getHeader().
Referenced by Gettext\Utils\FunctionsScanner\saveGettextFunctions(), and Gettext\Generators\PhpArray\toArray().
Gettext\Translations::getHeader | ( | $name | ) |
Returns a header value.
string | $name |
Definition at line 194 of file Translations.php.
References $name.
Referenced by Gettext\Extractors\Po\parseHeaders(), and Gettext\Generators\PhpArray\toArray().
Gettext\Translations::getHeaders | ( | ) |
Returns all header for this translations.
Definition at line 204 of file Translations.php.
Referenced by Gettext\Translations\mergeWith(), Gettext\Generators\Po\toString(), and Gettext\Generators\Mo\toString().
Gettext\Translations::getLanguage | ( | ) |
Returns the language value.
Definition at line 232 of file Translations.php.
References Dflydev\FigCookies\getHeader().
Referenced by Gettext\Translations\mergeWith(), and Gettext\Generators\PhpArray\toArray().
Gettext\Translations::getPluralForms | ( | ) |
Returns the parsed plural definition.
null|array | [count, rule] |
Definition at line 154 of file Translations.php.
References $header, array, and Dflydev\FigCookies\getHeader().
Referenced by Gettext\Translations\mergeWith().
Gettext\Translations::hasDomain | ( | ) |
Checks whether the domain is empty or not.
Definition at line 294 of file Translations.php.
References $domain.
Gettext\Translations::hasLanguage | ( | ) |
Checks whether the language is empty or not.
Definition at line 262 of file Translations.php.
Gettext\Translations::insert | ( | $context, | |
$original, | |||
$plural = '' |
|||
) |
Creates and insert/merges a new translation.
string | $context | The translation context |
string | $original | The translation original string |
string | $plural | The translation original plural string |
Definition at line 329 of file Translations.php.
Referenced by Gettext\Extractors\Jed\insertTranslation(), Gettext\Extractors\PhpArray\insertTranslation(), and Gettext\Utils\FunctionsScanner\saveGettextFunctions().
Gettext\Translations::mergeWith | ( | Translations | $translations, |
$method = null |
|||
) |
Merges this translations with other translations.
Translations | $translations | The translations instance to merge with |
int | null | $method | One or various Translations::MERGE_* constants to define how to merge the translations |
Definition at line 340 of file Translations.php.
References $name, array, Gettext\Translations\find(), Dflydev\FigCookies\getHeader(), Gettext\Translations\getHeaders(), Gettext\Translations\getLanguage(), and Gettext\Translations\getPluralForms().
Gettext\Translations::offsetSet | ( | $index, | |
$value | |||
) |
Control the new translations added.
mixed | $index | |
Translation | $value |
InvalidArgumentException | If the value is not an instance of Gettext |
Definition at line 116 of file Translations.php.
References $id.
Gettext\Translations::setDomain | ( | $domain | ) |
Set a new domain for this translations.
string | $domain |
Definition at line 274 of file Translations.php.
References $domain.
Referenced by Gettext\Extractors\PhpArray\handleArray().
Gettext\Translations::setHeader | ( | $name, | |
$value | |||
) |
Set a new header.
string | $name | |
string | $value |
Definition at line 169 of file Translations.php.
Referenced by Gettext\Extractors\Po\parseHeaders().
Gettext\Translations::setLanguage | ( | $language | ) |
Sets the language and the plural forms.
string | $language |
Definition at line 244 of file Translations.php.
References $info.
Gettext\Translations::setPluralForms | ( | $count, | |
$rule | |||
) |
Set the plural definition.
int | $count | |
string | $rule |
Definition at line 144 of file Translations.php.
|
private |
Definition at line 28 of file Translations.php.
|
static |
Definition at line 26 of file Translations.php.
|
private |
Definition at line 29 of file Translations.php.
const Gettext\Translations::HEADER_DOMAIN = 'X-Domain' |
Definition at line 24 of file Translations.php.
const Gettext\Translations::HEADER_LANGUAGE = 'Language' |
Definition at line 22 of file Translations.php.
const Gettext\Translations::HEADER_PLURAL = 'Plural-Forms' |
Definition at line 23 of file Translations.php.
const Gettext\Translations::MERGE_ADD = 1 |
Definition at line 13 of file Translations.php.
const Gettext\Translations::MERGE_COMMENTS = 16 |
Definition at line 17 of file Translations.php.
const Gettext\Translations::MERGE_HEADERS = 4 |
Definition at line 15 of file Translations.php.
const Gettext\Translations::MERGE_LANGUAGE = 32 |
Definition at line 18 of file Translations.php.
const Gettext\Translations::MERGE_OVERRIDE = 128 |
Definition at line 20 of file Translations.php.
const Gettext\Translations::MERGE_PLURAL = 64 |
Definition at line 19 of file Translations.php.
const Gettext\Translations::MERGE_REFERENCES = 8 |
Definition at line 16 of file Translations.php.
const Gettext\Translations::MERGE_REMOVE = 2 |
Definition at line 14 of file Translations.php.