|
ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Class to manage a translation string. More...
Collaboration diagram for Gettext\Translation:Public Member Functions | |
| __construct ($context, $original, $plural='') | |
| Construct. More... | |
| getClone ($context=null, $original=null) | |
| Clones this translation. More... | |
| getId () | |
| Returns the id of this translation. More... | |
| is ($context, $original='') | |
| Checks whether the translation matches with the arguments. More... | |
| getOriginal () | |
| Gets the original string. More... | |
| hasOriginal () | |
| Checks if the original string is empty or not. More... | |
| setTranslation ($translation) | |
| Sets the translation string. More... | |
| getTranslation () | |
| Gets the translation string. More... | |
| hasTranslation () | |
| Checks if the translation string is empty or not. More... | |
| setPlural ($plural) | |
| Sets the plural translation string. More... | |
| getPlural () | |
| Gets the plural translation string. More... | |
| hasPlural () | |
| Checks if the plural translation string is empty or not. More... | |
| setPluralTranslation ($plural, $key=0) | |
| Set a new plural translation. More... | |
| getPluralTranslation ($key=null) | |
| Gets one or all plural translations. More... | |
| hasPluralTranslation () | |
| Checks if there are any plural translation. More... | |
| deletePluralTranslation () | |
| Removes all plural translations. More... | |
| setTranslationCount ($count) | |
| Set the number of singular + plural translations allowed. More... | |
| getTranslationCount () | |
| Returns the number of singular + plural translations Returns null if this Translation is not a plural one. More... | |
| getContext () | |
| Gets the context of this translation. More... | |
| hasContext () | |
| Checks if the context is empty or not. More... | |
| addReference ($filename, $line=null) | |
| Adds a new reference for this translation. More... | |
| hasReferences () | |
| Checks if the translation has any reference. More... | |
| getReferences () | |
| Return all references for this translation. More... | |
| deleteReferences () | |
| Removes all references. More... | |
| addComment ($comment) | |
| Adds a new comment for this translation. More... | |
| hasComments () | |
| Checks if the translation has any comment. More... | |
| getComments () | |
| Returns all comments for this translation. More... | |
| deleteComments () | |
| Removes all comments. More... | |
| addExtractedComment ($comment) | |
| Adds a new extracted comment for this translation. More... | |
| hasExtractedComments () | |
| Checks if the translation has any extracted comment. More... | |
| getExtractedComments () | |
| Returns all extracted comments for this translation. More... | |
| deleteExtractedComments () | |
| Removes all extracted comments. More... | |
| addFlag ($flag) | |
| Adds a new flat for this translation. More... | |
| hasFlags () | |
| Checks if the translation has any flag. More... | |
| getFlags () | |
| Returns all extracted flags for this translation. More... | |
| deleteFlags () | |
| Removes all flags. More... | |
| mergeWith (Translation $translation, $method=null) | |
| Merges this translation with other translation. More... | |
Static Public Member Functions | |
| static | generateId ($context, $original) |
| Generates the id of a translation (context + glue + original). More... | |
Protected Member Functions | |
| normalizeTranslationCount () | |
| Normalizes the translation count. More... | |
Protected Attributes | |
| $context | |
| $original | |
| $translation = '' | |
| $plural | |
| $pluralTranslation = array() | |
| $references = array() | |
| $comments = array() | |
| $extractedComments = array() | |
| $flags = array() | |
| $translationCount | |
Class to manage a translation string.
Definition at line 8 of file Translation.php.
| Gettext\Translation::__construct | ( | $context, | |
| $original, | |||
$plural = '' |
|||
| ) |
Construct.
| string | $context | The context of the translation |
| string | $original | The original string |
| string | $plural | The original plural string |
Definition at line 41 of file Translation.php.
| Gettext\Translation::addComment | ( | $comment | ) |
Adds a new comment for this translation.
| string | $comment |
Definition at line 334 of file Translation.php.
References $comment.
| Gettext\Translation::addExtractedComment | ( | $comment | ) |
Adds a new extracted comment for this translation.
| string | $comment |
Definition at line 372 of file Translation.php.
References $comment.
| Gettext\Translation::addFlag | ( | $flag | ) |
Adds a new flat for this translation.
| string | $flag |
Definition at line 410 of file Translation.php.
| Gettext\Translation::addReference | ( | $filename, | |
$line = null |
|||
| ) |
Adds a new reference for this translation.
| string | $filename | The file path where the translation has been found |
| null | int | $line | The line number where the translation has been found |
Definition at line 295 of file Translation.php.
| Gettext\Translation::deleteComments | ( | ) |
Removes all comments.
Definition at line 362 of file Translation.php.
| Gettext\Translation::deleteExtractedComments | ( | ) |
Removes all extracted comments.
Definition at line 400 of file Translation.php.
| Gettext\Translation::deleteFlags | ( | ) |
Removes all flags.
Definition at line 438 of file Translation.php.
| Gettext\Translation::deletePluralTranslation | ( | ) |
Removes all plural translations.
Definition at line 216 of file Translation.php.
| Gettext\Translation::deleteReferences | ( | ) |
Removes all references.
Definition at line 324 of file Translation.php.
|
static |
Generates the id of a translation (context + glue + original).
| string | $context | |
| string | $original |
Definition at line 29 of file Translation.php.
| Gettext\Translation::getClone | ( | $context = null, |
|
$original = null |
|||
| ) |
Clones this translation.
| null | string | $context | Optional new context |
| null | string | $original | Optional new original |
Definition at line 55 of file Translation.php.
References $new.
| Gettext\Translation::getComments | ( | ) |
Returns all comments for this translation.
Definition at line 354 of file Translation.php.
Referenced by Gettext\Translation\mergeWith().
Here is the caller graph for this function:| Gettext\Translation::getContext | ( | ) |
| Gettext\Translation::getExtractedComments | ( | ) |
Returns all extracted comments for this translation.
Definition at line 392 of file Translation.php.
Referenced by Gettext\Translation\mergeWith().
Here is the caller graph for this function:| Gettext\Translation::getFlags | ( | ) |
Returns all extracted flags for this translation.
Definition at line 430 of file Translation.php.
Referenced by Gettext\Translation\mergeWith().
Here is the caller graph for this function:| Gettext\Translation::getId | ( | ) |
Returns the id of this translation.
Definition at line 75 of file Translation.php.
| Gettext\Translation::getOriginal | ( | ) |
| Gettext\Translation::getPlural | ( | ) |
Gets the plural translation string.
Definition at line 160 of file Translation.php.
Referenced by Gettext\Translation\mergeWith().
Here is the caller graph for this function:| Gettext\Translation::getPluralTranslation | ( | $key = null | ) |
Gets one or all plural translations.
| int | null | $key | The key to return. If is null, return all translations |
Definition at line 194 of file Translation.php.
References $key.
Referenced by Gettext\Translation\mergeWith().
Here is the caller graph for this function:| Gettext\Translation::getReferences | ( | ) |
Return all references for this translation.
Definition at line 316 of file Translation.php.
Referenced by Gettext\Translation\mergeWith().
Here is the caller graph for this function:| Gettext\Translation::getTranslation | ( | ) |
Gets the translation string.
Definition at line 128 of file Translation.php.
Referenced by Gettext\Translation\mergeWith().
Here is the caller graph for this function:| Gettext\Translation::getTranslationCount | ( | ) |
Returns the number of singular + plural translations Returns null if this Translation is not a plural one.
Definition at line 241 of file Translation.php.
| Gettext\Translation::hasComments | ( | ) |
Checks if the translation has any comment.
Definition at line 344 of file Translation.php.
| Gettext\Translation::hasContext | ( | ) |
Checks if the context is empty or not.
Definition at line 284 of file Translation.php.
| Gettext\Translation::hasExtractedComments | ( | ) |
Checks if the translation has any extracted comment.
Definition at line 382 of file Translation.php.
| Gettext\Translation::hasFlags | ( | ) |
Checks if the translation has any flag.
Definition at line 420 of file Translation.php.
| Gettext\Translation::hasOriginal | ( | ) |
Checks if the original string is empty or not.
Definition at line 108 of file Translation.php.
| Gettext\Translation::hasPlural | ( | ) |
Checks if the plural translation string is empty or not.
Definition at line 170 of file Translation.php.
| Gettext\Translation::hasPluralTranslation | ( | ) |
Checks if there are any plural translation.
Definition at line 208 of file Translation.php.
Referenced by Gettext\Translation\mergeWith().
Here is the caller graph for this function:| Gettext\Translation::hasReferences | ( | ) |
Checks if the translation has any reference.
Definition at line 306 of file Translation.php.
| Gettext\Translation::hasTranslation | ( | ) |
Checks if the translation string is empty or not.
Definition at line 138 of file Translation.php.
Referenced by Gettext\Translation\mergeWith().
Here is the caller graph for this function:| Gettext\Translation::is | ( | $context, | |
$original = '' |
|||
| ) |
Checks whether the translation matches with the arguments.
| string | $context | |
| string | $original |
Definition at line 88 of file Translation.php.
| Gettext\Translation::mergeWith | ( | Translation | $translation, |
$method = null |
|||
| ) |
Merges this translation with other translation.
| Translation | $translation | The translation to merge with |
| int | null | $method | One or various Translations::MERGE_* constants to define how to merge the translations |
Definition at line 449 of file Translation.php.
References Gettext\Translation\getComments(), Gettext\Translation\getExtractedComments(), Gettext\Translation\getFlags(), Gettext\Translation\getPlural(), Gettext\Translation\getPluralTranslation(), Gettext\Translation\getReferences(), Gettext\Translation\getTranslation(), Gettext\Translation\hasPluralTranslation(), and Gettext\Translation\hasTranslation().
Here is the call graph for this function:
|
protected |
Normalizes the translation count.
Definition at line 249 of file Translation.php.
References $current.
| Gettext\Translation::setPlural | ( | $plural | ) |
Sets the plural translation string.
| string | $plural |
Definition at line 148 of file Translation.php.
| Gettext\Translation::setPluralTranslation | ( | $plural, | |
$key = 0 |
|||
| ) |
Set a new plural translation.
| string | $plural | The plural string to add |
| int | $key | The key of the plural translation. |
Definition at line 181 of file Translation.php.
References $key.
| Gettext\Translation::setTranslation | ( | $translation | ) |
Sets the translation string.
| string | $translation |
Definition at line 118 of file Translation.php.
| Gettext\Translation::setTranslationCount | ( | $count | ) |
Set the number of singular + plural translations allowed.
| int | $count |
Definition at line 228 of file Translation.php.
|
protected |
Definition at line 16 of file Translation.php.
|
protected |
Definition at line 10 of file Translation.php.
|
protected |
Definition at line 17 of file Translation.php.
|
protected |
Definition at line 18 of file Translation.php.
|
protected |
Definition at line 11 of file Translation.php.
|
protected |
Definition at line 13 of file Translation.php.
|
protected |
Definition at line 14 of file Translation.php.
|
protected |
Definition at line 15 of file Translation.php.
|
protected |
Definition at line 12 of file Translation.php.
|
protected |
Definition at line 19 of file Translation.php.