.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Log::Report::Lexicon::PO 3pm" .TH Log::Report::Lexicon::PO 3pm "2022-12-06" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Log::Report::Lexicon::PO \- one translation definition .SH "SYNOPSIS" .IX Header "SYNOPSIS" .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module is administering one translation object. Sets of \s-1PO\s0 records are kept in a \s-1POT\s0 file, implemented in Log::Report::Lexicon::POT. .SH "METHODS" .IX Header "METHODS" .SS "Constructors" .IX Subsection "Constructors" .IP "Log::Report::Lexicon::PO\->\fBnew\fR(%options)" 4 .IX Item "Log::Report::Lexicon::PO->new(%options)" .Vb 10 \& \-Option \-\-Default \& automatic "" \& comment [] \& format [] \& fuzzy false \& msgctxt undef \& msgid \& msgid_plural undef \& msgstr "" or [] \& references [] .Ve .RS 4 .IP "automatic => \s-1PARAGRAPH\s0" 2 .IX Item "automatic => PARAGRAPH" Automatically added comments. See \fBaddAutomatic()\fR. .IP "comment => \s-1PARAGRAPH\s0" 2 .IX Item "comment => PARAGRAPH" Translator added comments. See \fBaddComment()\fR. .IP "format => ARRAY|HASH" 2 .IX Item "format => ARRAY|HASH" See \fBformat()\fR. Either an \s-1ARRAY\s0 with \s-1PAIRS\s0 or a \s-1HASH\s0 with that same information. .IP "fuzzy => \s-1BOOLEAN\s0" 2 .IX Item "fuzzy => BOOLEAN" The string is not yet translated, some smart guesses may have been made. See \fBfuzzy()\fR. .IP "msgctxt => \s-1STRING\s0" 2 .IX Item "msgctxt => STRING" Context string: text around the msgid itself. .IP "msgid => \s-1STRING\s0" 2 .IX Item "msgid => STRING" .PD 0 .IP "msgid_plural => \s-1STRING\s0" 2 .IX Item "msgid_plural => STRING" .IP "msgstr => STRING|ARRAY\-OF\-STRING" 2 .IX Item "msgstr => STRING|ARRAY-OF-STRING" .PD The translations for the msgid. When msgid_plural is defined, then an \&\s-1ARRAY\s0 must be provided. .IP "references => STRING|ARRAY\-OF\-LOCATIONS" 2 .IX Item "references => STRING|ARRAY-OF-LOCATIONS" The \s-1STRING\s0 is a blank separated list of \s-1LOCATIONS.\s0 LOCATIONs are of the form \f(CW\*(C`filename:linenumber\*(C'\fR, for instance \f(CW\*(C`lib/Foo.pm:42\*(C'\fR See \fBaddReferences()\fR .RE .RS 4 .RE .SS "Attributes" .IX Subsection "Attributes" .ie n .IP "$obj\->\fBaddAutomatic\fR(LIST|ARRAY|STRING)" 4 .el .IP "\f(CW$obj\fR\->\fBaddAutomatic\fR(LIST|ARRAY|STRING)" 4 .IX Item "$obj->addAutomatic(LIST|ARRAY|STRING)" Add multiple lines to the translator's comment block. Returns an empty string if there are no comments. .ie n .IP "$obj\->\fBaddComment\fR(LIST|ARRAY|STRING)" 4 .el .IP "\f(CW$obj\fR\->\fBaddComment\fR(LIST|ARRAY|STRING)" 4 .IX Item "$obj->addComment(LIST|ARRAY|STRING)" Add multiple lines to the translator's comment block. Returns an empty string if there are no comments. .ie n .IP "$obj\->\fBaddFlags\fR(\s-1STRING\s0)" 4 .el .IP "\f(CW$obj\fR\->\fBaddFlags\fR(\s-1STRING\s0)" 4 .IX Item "$obj->addFlags(STRING)" Parse a \*(L"flags\*(R" line. .ie n .IP "$obj\->\fBaddReferences\fR(STRING|LIST|ARRAY)" 4 .el .IP "\f(CW$obj\fR\->\fBaddReferences\fR(STRING|LIST|ARRAY)" 4 .IX Item "$obj->addReferences(STRING|LIST|ARRAY)" The \s-1STRING\s0 is a blank separated list of \s-1LOCATIONS.\s0 The \s-1LIST\s0 and \&\s-1ARRAY\s0 contain separate LOCATIONs. A \s-1LOCATION\s0 is of the form \&\f(CW\*(C`filename:linenumber\*(C'\fR. Returns the internal \s-1HASH\s0 with references. .ie n .IP "$obj\->\fBautomatic\fR( [LIST|ARRAY|STRING] )" 4 .el .IP "\f(CW$obj\fR\->\fBautomatic\fR( [LIST|ARRAY|STRING] )" 4 .IX Item "$obj->automatic( [LIST|ARRAY|STRING] )" Returns a \s-1STRING\s0 which contains the cleaned paragraph of automatically added comments. If an argument is specified, it will replace the current comment. .ie n .IP "$obj\->\fBcomment\fR( [LIST|ARRAY|STRING] )" 4 .el .IP "\f(CW$obj\fR\->\fBcomment\fR( [LIST|ARRAY|STRING] )" 4 .IX Item "$obj->comment( [LIST|ARRAY|STRING] )" Returns a \s-1STRING\s0 which contains the cleaned paragraph of translator's comment. If an argument is specified, it will replace the current comment. .ie n .IP "$obj\->\fBformat\fR( $language | )" 4 .el .IP "\f(CW$obj\fR\->\fBformat\fR( \f(CW$language\fR | )" 4 .IX Item "$obj->format( $language | )" When one \f(CW$language\fR is specified, it looks whether a \f(CW\*(C`$language\-format\*(C'\fR or \&\f(CW\*(C`no\-$language\-format\*(C'\fR is present in the line of \s-1FLAGS.\s0 This will return \&\f(CW1\fR (true) in the first case, \f(CW0\fR (false) in the second case. It will return \f(CW\*(C`undef\*(C'\fR (also false) in case that both are not present. .Sp You can also specify \s-1PAIRS:\s0 the key is a language name, and the value is either \f(CW0\fR, \f(CW1\fR, or \f(CW\*(C`undef\*(C'\fR. .Sp example: use of \fBformat()\fR .Sp .Vb 4 \& # getters \& if($po\->format(\*(Aqc\*(Aq)) ... \& unless($po\->format(\*(Aqperl\-brace\*(Aq)) ... \& if(defined $po\->format(\*(Aqjava\*(Aq)) ... \& \& # setters \& $po\->format(java => 1); # results in \*(Aqjava\-format\*(Aq \& $po\->format(java => 0); # results in \*(Aqno\-java\-format\*(Aq \& $po\->format(java => undef); # results in \*(Aq\*(Aq .Ve .ie n .IP "$obj\->\fBfuzzy\fR( [\s-1BOOLEAN\s0] )" 4 .el .IP "\f(CW$obj\fR\->\fBfuzzy\fR( [\s-1BOOLEAN\s0] )" 4 .IX Item "$obj->fuzzy( [BOOLEAN] )" Returns whether the translation needs human inspection. .ie n .IP "$obj\->\fBisActive\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBisActive\fR()" 4 .IX Item "$obj->isActive()" Returns whether the translation has any references, or is the header. .ie n .IP "$obj\->\fBkeepReferencesTo\fR($table)" 4 .el .IP "\f(CW$obj\fR\->\fBkeepReferencesTo\fR($table)" 4 .IX Item "$obj->keepReferencesTo($table)" Remove all references which are not found as key in the hash \f(CW$table\fR. Returns the number of references left. .ie n .IP "$obj\->\fBmsgctxt\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBmsgctxt\fR()" 4 .IX Item "$obj->msgctxt()" Returns the message context, if provided. .ie n .IP "$obj\->\fBmsgid\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBmsgid\fR()" 4 .IX Item "$obj->msgid()" Returns the actual msgid, which cannot be \f(CW\*(C`undef\*(C'\fR. .ie n .IP "$obj\->\fBmsgstr\fR( [$index, [\s-1STRING\s0]] )" 4 .el .IP "\f(CW$obj\fR\->\fBmsgstr\fR( [$index, [\s-1STRING\s0]] )" 4 .IX Item "$obj->msgstr( [$index, [STRING]] )" With a \s-1STRING,\s0 a new translation will be set. Without \s-1STRING,\s0 a lookup will take place. When no plural is defined, the \f(CW$index\fR is ignored. .ie n .IP "$obj\->\fBplural\fR( [\s-1STRING\s0] )" 4 .el .IP "\f(CW$obj\fR\->\fBplural\fR( [\s-1STRING\s0] )" 4 .IX Item "$obj->plural( [STRING] )" Returns the actual msgid_plural, which can be \f(CW\*(C`undef\*(C'\fR. .ie n .IP "$obj\->\fBreferences\fR( [STRING|LIST|ARRAY] )" 4 .el .IP "\f(CW$obj\fR\->\fBreferences\fR( [STRING|LIST|ARRAY] )" 4 .IX Item "$obj->references( [STRING|LIST|ARRAY] )" Returns an unsorted list of \s-1LOCATIONS.\s0 When options are specified, then those will be used to replace all currently defined references. Returns the unsorted \s-1LIST\s0 of references. .ie n .IP "$obj\->\fBremoveReferencesTo\fR($filename)" 4 .el .IP "\f(CW$obj\fR\->\fBremoveReferencesTo\fR($filename)" 4 .IX Item "$obj->removeReferencesTo($filename)" Remove all the references to the indicate \f(CW$filename\fR from the list. Returns the number of refs left. .SS "Parsing" .IX Subsection "Parsing" .IP "Log::Report::Lexicon::PO\->\fBfromText\fR( \s-1STRING,\s0 [$where] )" 4 .IX Item "Log::Report::Lexicon::PO->fromText( STRING, [$where] )" Parse the \s-1STRING\s0 into a new \s-1PO\s0 object. The \f(CW$where\fR string should explain the location of the \s-1STRING,\s0 to be used in error messages. .ie n .IP "$obj\->\fBtoString\fR(%options)" 4 .el .IP "\f(CW$obj\fR\->\fBtoString\fR(%options)" 4 .IX Item "$obj->toString(%options)" Format the object into a multi-lined string. .Sp .Vb 2 \& \-Option \-\-Default \& nr_plurals undef .Ve .RS 4 .IP "nr_plurals => \s-1INTEGER\s0" 2 .IX Item "nr_plurals => INTEGER" 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. .RE .RS 4 .RE .ie n .IP "$obj\->\fBuseless\fR()" 4 .el .IP "\f(CW$obj\fR\->\fBuseless\fR()" 4 .IX Item "$obj->useless()" [1.02] The message-id has no references anymore \fBand\fR no translations. .SH "SEE ALSO" .IX Header "SEE ALSO" This module is part of Log-Report-Lexicon distribution version 1.11, built on March 22, 2018. Website: \fIhttp://perl.overmeer.net/CPAN/\fR .SH "LICENSE" .IX Header "LICENSE" Copyrights 2007\-2018 by [Mark Overmeer ]. For other contributors see ChangeLog. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See \fIhttp://dev.perl.org/licenses/\fR