| package | pomo |
|---|
add_entry(array|\Translation_Entry $entry) : boolean
| since | 2.8.0 |
|---|
array\Translation_Entry
booleanTrue on success, false if the entry doesn't have a key.add_entry_or_merge(array|\Translation_Entry $entry) : boolean
| since | 2.8.0 |
|---|
array\Translation_Entry
booleanTrue on success, false if the entry doesn't have a key.get_header(string $header) : string | false
| since | 2.8.0 |
|---|
string
stringfalseHeader if it exists, false otherwise.get_plural_forms_count() : integer
| since | 2.8.0 |
|---|
integerPlural forms count.merge_originals_with(\Translations $other)
| since | 2.8.0 |
|---|
\Translations
merge_with(\Translations $other)
| since | 2.8.0 |
|---|
\TranslationsAnother Translation object, whose translations will be merged in this one (passed by reference).
select_plural_form(integer $count) : integer
Here, in the base Translations class, the common logic for English is implemented: 0 if there is one element, 1 otherwise
This function should be overridden by the subclasses. For example MO/PO can derive the logic from their headers.
| since | 2.8.0 |
|---|
integerNumber of items.
integerPlural form to use.set_header(string $header, string $value)
If the header already exists, it will be overwritten
TODO: this should be out of this class, it is gettext specific
| since | 2.8.0 |
|---|
stringheader name, without trailing :
stringheader value, without trailing \n
set_headers(array $headers)
| since | 2.8.0 |
|---|
arrayAssociative array of headers.
translate(string $singular, string $context = null) : string
| since | 2.8.0 |
|---|
string
string
stringtranslate_entry(\Translation_Entry $entry) : \Translation_Entry | false
| since | 2.8.0 |
|---|
\Translation_EntryTranslation entry.
\Translation_EntryfalseTranslation entry if it exists, false otherwise.translate_plural(string $singular, string $plural, integer $count, string $context = null) : string
| since | 2.8.0 |
|---|
string
string
integer
string
string$entries : array<mixed,\Translation_Entry>
array()| since | 2.8.0 |
|---|
$headers : \array<string,
array()| since | 2.8.0 |
|---|