METHODS

Constructors

$class->new( %options )
See new in Log::Report::Lexicon::Table.
$class->read( $filename, %options )

Read the MOT table information from $filename.

Option Default

charset

<from header>

charset => STRING
The character-set which is used for the file. When not specified, it is taken from the "Content-Type" field in the PO-file.

Attributes

$obj->filename

Returns the name of the source file for this data.

$obj->index

Returns a HASH of all defined PO objects, organized by msgid. Please try to avoid using this: use msgid() for lookup.

$obj->originalCharset

Returns the character-set as found in the PO-file. The strings are converted into utf8 before you use them in the program.

Managing PO's

Translation

$obj->msgid( STRING, [$msgctxt] )

Lookup the translations with the STRING. Returns a SCALAR, when only one translation is known, and an ARRAY when we have plural forms. Returns undef when the translation is not defined.

$obj->msgstr( $msgid, [$count, $msgctxt] )

Returns the translated string for $msgid. When not specified, $count is 1 (the singular form).

Administration

$obj->add( $po )
See add in Log::Report::Lexicon::Table.
$obj->nrPlurals
See nrPlurals in Log::Report::Lexicon::Table.
$obj->pluralIndex( $count )
See pluralIndex in Log::Report::Lexicon::Table.
$obj->setupPluralAlgorithm
See setupPluralAlgorithm in Log::Report::Lexicon::Table.
$obj->translations( [$active] )
See translations in Log::Report::Lexicon::Table.