# this is usually not for end-users, See ::Extract::PerlPPI # using a PO table my $pot = Log::Report::Lexicon::POT ->read('po/nl.po', charset => 'utf-8') or die; my $po = $pot->msgid('msgid'); my $po = $pot->msgid($msgid, $msgctxt); print $pot->nrPlurals; print $pot->msgstr('msgid', 3); print $pot->msgstr($msgid, 3, $msgctxt); $pot->write; # update the file # fill the table, by calling the next a lot my $po = Log::Report::Lexicon::PO->new(...); $pot->add($po); # creating a PO table $pot->write('po/nl.po') or die;
See SYNOPSIS in Log::Report::Lexicon::Table
This module is reading, extending, and writing POT files. POT files are used to store translations in humanly readable format for most of existing translation frameworks, like GNU gettext and Perl's Maketext. If you only wish to access the translation, then you may use the much more efficient Log::Report::Lexicon::POTcompact.
The code is loosely based on Locale::PO, by Alan Schwartz. The coding
style is a bit off the rest of Log::Report
, and there was a need to
sincere simplification. Each PO record will be represented by a
Log::Report::Lexicon::PO.