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

<required>

take_all

<true>

charset => STRING
The character-set which is used for the file. You must specify this explicitly, while it cannot be trustfully detected automatically.
take_all => BOOLEAN
This will cause the whole translation table to be read at once. If false, a file-handle will be kept open and translations read on demand. That may (but very well may not) save a memory foot-print, especially when the strings are large.

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.

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.