Log::Report::Lexicon::PO - one translation definition
This module is administering one translation object. Sets of PO records are kept in a POT file, implemented in Log::Report::Lexicon::POT.
-Option --Default automatic "" comment [] format [] fuzzy false msgctxt undef msgid <required> msgid_plural undef msgstr "" or [] references []
Automatically added comments. See addAutomatic().
Translator added comments. See addComment().
See format(). Either an ARRAY with PAIRS or a HASH with that same information.
The string is not yet translated, some smart guesses may have been made. See fuzzy().
Context string: text around the msgid itself.
The translations for the msgid. When msgid_plural is defined, then an ARRAY must be provided.
The STRING is a blank separated list of LOCATIONS. LOCATIONs are of the form filename:linenumber, for instance lib/Foo.pm:42 See addReferences()
filename:linenumber
lib/Foo.pm:42
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.
$language-format
no-$language-format
1
0
undef
You can also specify PAIRS: the key is a language name, and the value is either 0, 1, or undef.
example: use of format()
# getters if($po->format('c')) ... unless($po->format('perl-brace')) ... if(defined $po->format('java')) ... # setters $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 undef
If the number of plurals is specified, then the plural translation list can be checked for the correct length. Otherwise, no smart behavior is attempted.
[1.02] The message-id has no references anymore and no translations.
This module is part of Log-Report-Lexicon distribution version 1.02, built on March 10, 2014. Website: http://perl.overmeer.net/log-report/
Copyrights 2007-2014 by [Mark Overmeer]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html
To install Log::Report::Lexicon, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Report::Lexicon
CPAN shell
perl -MCPAN -e shell install Log::Report::Lexicon
For more information on module installation, please visit the detailed CPAN module installation guide.