.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" 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 turned on, 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 .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Log::Report::Lexicon::PO 3pm" .TH Log::Report::Lexicon::PO 3pm "2014-06-04" "perl v5.18.2" "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 \fIaddAutomatic()\fR. .IP "comment => \s-1PARAGRAPH\s0" 2 .IX Item "comment => PARAGRAPH" Translator added comments. See \fIaddComment()\fR. .IP "format => ARRAY|HASH" 2 .IX Item "format => ARRAY|HASH" See \fIformat()\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 \fIfuzzy()\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 \fIaddReferences()\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 \fIformat()\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.03, built on June 04, 2014. Website: \fIhttp://perl.overmeer.net/log\-report/\fR .SH "LICENSE" .IX Header "LICENSE" Copyrights 2007\-2014 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://www.perl.com/perl/misc/Artistic.html\fR