| package | pomo |
|---|---|
| inherited_from | \Gettext_Translations |
add_entry(array|\Translation_Entry $entry) : boolean
array\Translation_Entry
booleantrue on success, false if the entry doesn't have a keyadd_entry_or_merge(array|\Translation_Entry $entry) : boolean
array\Translation_Entry
booleanexport() : string | false
stringfalse
export_headers() : string
stringexport_original(\Translation_Entry $entry) : string
\Translation_Entry
stringexport_to_file(string $filename) : boolean
string
booleanexport_to_file_handle(resource $fh) : true
resource
trueexport_translations(\Translation_Entry $entry) : string
\Translation_Entry
stringget_byteorder(integer $magic) : string | false
integer
stringfalse
get_filename() : string
stringThe loaded MO file.get_header(string $header)
string
get_plural_forms_count() : integer
integerget_plural_forms_count() : integer
integergettext_select_plural_form(integer $count)
It lives in this class, because there are more than one descendand, which will use it and they can't share it effectively.
integer
import_from_file(string $filename) : boolean
stringMO file to load
booleanTrue if the import from file was successful, otherwise false.import_from_reader(\POMO_FileReader $reader) : boolean
\POMO_FileReader
booleanTrue if the import was successful, otherwise false.is_entry_good_for_export(\Translation_Entry $entry) : boolean
\Translation_Entry
booleanmake_entry(string $original, string $translation) : \Translation_Entry
| static |
|---|
stringoriginal string to translate from MO file. Might contain 0x04 as context separator or 0x00 as singular/plural separator
stringtranslation string from MO file. Might contain 0x00 as a plural translations separator
\Translation_EntryEntry instance.make_headers(string $translation) : array
string
arraymake_plural_form_function(integer $nplurals, string $expression)
integer
string
merge_originals_with(object $other)
object
merge_with(Object $other) : void
ObjectAnother Translation object, whose translations will be merged in this one (passed by reference).
nplurals_and_expression_from_header(string $header) : array
string
arrayparenthesize_plural_exression(string $expression) : string
stringthe expression without parentheses
stringthe expression with parentheses addedselect_plural_form(integer $count) : string
integer
stringselect_plural_form(integer $count)
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 sub-classes. For example MO/PO can derive the logic from their headers.
integernumber of items
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
stringheader name, without trailing :
stringheader value, without trailing \n
set_headers(array $headers)
array
translate(string $singular, string $context = null) : string
string
string
stringtranslate_entry(\Translation_Entry $entry)
\Translation_Entry
translate_plural(string $singular, string $plural, integer $count, string $context = null)
string
string
integer
string
$_nplurals
2$entries
array()$headers
array()$filename : string
''