METHODS

Constructors

$class->new( OPTIONS )
See new in Log::Report::Lexicon::Table.
$class->read( FILENAME, OPTIONS )

Read the MOT table information from FILENAME. The msgctxt (context) is ignored.

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 )

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, CONTEXT] )

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.