| package | pomo | 
|---|---|
| inherited_from | \Gettext_Translations | 
add_entry(array | \Translation_Entry $entry) : boolean
array\Translation_Entry&$entry
booleantrue on success, false if the entry doesn't have a keyadd_entry_or_merge(array|\Translation_Entry $entry) : boolean
array\Translation_Entry
booleancomment_block(string $text, string $char = ' ') 
| access | private | 
|---|
stringthe comment text
stringcharacter to denote a special PO comment, like :, default is a space
export(boolean $include_headers = true) : string
booleanwhether to include the headers in the export
stringready for inclusion in PO file string for headers and all the enrtriesexport_entries() : string
stringsequence of mgsgid/msgstr PO strings, doesn't containt newline at the endexport_entry(\Translation_Entry $entry) : false | string
| static | 
|---|
\Translation_Entry&$entry the entry to convert to po string
falsestringPO-style formatted string for the entry or
	false if the entry is emptyexport_headers() : string
stringmsgid/msgstr PO entry for this PO file headers, doesn't contain newline at the endexport_to_file(string $filename, boolean $include_headers = true) : boolean
stringwhere to write the PO string
booleanwhether to include tje headers in the export
booleantrue on success, false on errorget_header(string $header)
string
get_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
string
booleanmake_headers(string $translation) : array
string
arraymake_plural_form_function(integer $nplurals, string $expression)
integer
string
match_begin_and_end_newlines($translation, $original)
merge_originals_with(object $other)
object
merge_with(Object $other) : void
Object&$other Another Translation object, whose translations will be merged in this one
nplurals_and_expression_from_header(string $header) : array
string
arrayparenthesize_plural_exression(string $expression) : string
stringthe expression without parentheses
stringthe expression with parentheses addedpoify(string $string) : string
| static | 
|---|
stringthe string to format
stringthe poified stringprepend_each_line(string $string, string $with)
| static | 
|---|
stringprepend lines in this string
stringprepend lines with this string
read_entry(resource $f, integer $lineno = 0) : null | false | array
resource
integer
nullfalsearray
read_line(resource $f, string $action = 'read') : boolean
| staticvar | string $last_line | 
|---|---|
| staticvar | boolean $use_last_line | 
resource
string
booleanselect_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 overrided by the sub-classes. For example MO/PO can derive the logic from their headers.
integernumber of items
set_comment_before_headers($text)
Doesn't need to include # in the beginning of lines, these are added automatically
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
trim_quotes(string $s) : \sring
string
\sringunpoify(string $string) : string
| static | 
|---|
stringPO-formatted string
stringenascaped string$comments_before_headers
''$entries
array()$headers
array()
add_comment_to_entry()
Parameters
$entry
\Translation_Entry$po_comment_line
string