- SEE ALSO
Log::Report::Lexicon::Table - generic interface to translation tables
Log::Report::Lexicon::Table is extended by Log::Report::Lexicon::MOTcompact Log::Report::Lexicon::POT Log::Report::Lexicon::POTcompact
# use one of the extensions, for instance: my $pot = Log::Report::Lexicon::POT ->read('po/nl.po', charset => 'utf-8') or panic;
This base class defines the generic interface for translation tables.
Currently, there are three extensions:
This is a relatively heavy implementation, used to read but also to write PO files. It is used by xgettext-perl, for instance, to administer the collection of discovered msgid's.
Light-weighted read-only access to PO-file information.
Read-only access to MO-file information. These binary MO-files are super efficient.
- $obj->msgid( STRING, [$msgctxt] )
Lookup the Log::Report::Lexicon::PO with the STRING. Returns
undefwhen not defined.
- $obj->msgstr( $msgid, [$count, $msgctxt] )
Returns the translated string for $msgid. When not specified, $count is 1.
Add the information from a $po into this POT. If the msgid of the $po is already known, that is an error.
The translation of a blank MSGID is used to store a MIME header, which contains some meta-data. The $field value is looked-up (case-insensitive) and returned.
Returns the number of plurals, when not known then '2'.
Returns the msgstr index used to translate a value of $count.
This method needs to be called after setting (reading or creating) a new table header, to interpret the plural algorithm as specified in the
Plural-Formsheader field. [1.09] The header field is not required when not used.
A full list of plural forms per language can be found at http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html
- $obj->translations( [$active] )
Returns a list with all defined Log::Report::Lexicon::PO objects. When the string
$activeis given as parameter, only objects which have references are returned.
This module is part of Log-Report-Lexicon distribution version 1.11, built on March 22, 2018. Website: http://perl.overmeer.net/CPAN/
Copyrights 2007-2018 by [Mark Overmeer <firstname.lastname@example.org>]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/