Option | Default |
---|---|
automatic | "" |
comment | [] |
format |
|
fuzzy |
|
msgctxt |
|
msgid | <required> |
msgid_plural |
|
msgstr | "" or [] |
references | [] |
Add multiple lines to the translator's comment block. Returns an empty string if there are no comments.
Add multiple lines to the translator's comment block. Returns an empty string if there are no comments.
Parse a "flags" line.
The STRING is a blank separated list of LOCATIONS. The LIST and
ARRAY contain separate LOCATIONs. A LOCATION is of the form
filename:linenumber
. Returns the internal HASH with references.
Returns a STRING which contains the cleaned paragraph of automatically added comments. If an argument is specified, it will replace the current comment.
Returns a STRING which contains the cleaned paragraph of translator's comment. If an argument is specified, it will replace the current comment.
When one LANGUAGE is specified, it looks whether a LANGUAGE-format
or
no-LANGUAGE-format
is present in the line of FLAGS. This will return
1
(true) in the first case, 0
(false) in the second case. It will
return undef
(also false) in case that both are not present.
You can also specify PAIRS: the key is a language name, and the
value is either 0
, 1
, or undef
.
if($po->format('c')) ... unless($po->format('perl-brace')) ... if(defined $po->format('java')) ... $po->format(java => 1); # results in 'java-format' $po->format(java => 0); # results in 'no-java-format' $po->format(java => undef); # results in ''
Returns whether the translation needs human inspection.
Returns whether the translation has any references, or is the header.
Remove all references which are not found as key in the hash TABLE. Returns the number of references left.
Returns the message context, if provided.
Returns the actual msgid, which cannot be undef
.
With a STRING, a new translation will be set. Without STRING, a lookup will take place. When no plural is defined, the INDEX is ignored.
Returns the actual msgid_plural, which can be undef
.
Returns an unsorted list of LOCATIONS. When options are specified, then those will be used to replace all currently defined references. Returns the unsorted LIST of references.
Remove all the references to the indicate FILENAME from the list. Returns the number of refs left.
Parse the STRING into a new PO object. The WHERE string should explain the location of the STRING, to be used in error messages.
Format the object into a multi-lined string.
Option | Default |
---|---|
nr_plurals |
|
The message-id has no references anymore and no translations.