PoItem
class PoItem (View source)
PoItem handles one translation.
Constants
| DELIMITER |
The delimiter used to split plural strings. This is the ETX (End of text) character and is used as a minimal means to separate singular and plural variants in source and translation text. It was found to be the most compatible delimiter for the supported databases. |
Properties
| protected string | $langcode | The language code this translation is in. |
|
| protected string | $context | The context this translation belongs to. |
|
| protected string|array | $source | The source string or array of strings if it has plurals. |
|
| protected bool | $plural | Flag indicating if this translation has plurals. |
|
| protected string | $comment | The comment of this translation. |
|
| protected string|array | $translation | The translation string or array of strings if it has plurals. |
Methods
Gets the language code of the currently used language.
Set the language code of the current language.
Gets the context this translation belongs to.
Set the context this translation belongs to.
Gets the source string or the array of strings if the translation has plurals.
Set the source string or the array of strings if the translation has plurals.
Gets the translation string or the array of strings if the translation has plurals.
Set the translation string or the array of strings if the translation has plurals.
Set if the translation has plural values.
Get if the translation has plural values.
Gets the comment of this translation.
Set the comment of this translation.
Create the PoItem from a structured array.
Output the PoItem as a string.
Details
string
getLangcode()
Gets the language code of the currently used language.
setLangcode(string $langcode)
Set the language code of the current language.
string
getContext()
Gets the context this translation belongs to.
setContext(string $context)
Set the context this translation belongs to.
string
getSource()
Gets the source string or the array of strings if the translation has plurals.
setSource(string|array $source)
Set the source string or the array of strings if the translation has plurals.
string
getTranslation()
Gets the translation string or the array of strings if the translation has plurals.
setTranslation(string|array $translation)
Set the translation string or the array of strings if the translation has plurals.
setPlural(bool $plural)
Set if the translation has plural values.
bool
isPlural()
Get if the translation has plural values.
string
getComment()
Gets the comment of this translation.
setComment(string $comment)
Set the comment of this translation.
setFromArray(array $values = [])
Create the PoItem from a structured array.
__toString()
Output the PoItem as a string.