$comments_before_headers
$comments_before_headers
export_to_file(string $filename, bool $include_headers) : bool
Same as {@link export}, but writes the result to a file
string | $filename | where to write the PO string |
bool | $include_headers | whether to include tje headers in the export |
true on success, false on error
parenthesize_plural_exression(string $expression) : string
Adds parantheses to the inner parts of ternary operators in plural expressions, because PHP evaluates ternary oerators from left to right
string | $expression | the expression without parentheses |
the expression with parentheses added
set_header(string $header, string $value)
Sets $header PO header to $value
If the header already exists, it will be overwritten
TODO: this should be out of this class, it is gettext specific
string | $header | header name, without trailing : |
string | $value | header value, without trailing \n |
select_plural_form(integer $count)
Given the number of items, returns the 0-based index of the plural form to use
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.
integer | $count | number of items |