INHERITANCE
Log::Report::Lexicon::MOTcompact is a Log::Report::Lexicon::Table
SYNOPSIS
# using a MO table efficiently
my $mot = Log::Report::Lexicon::MOTcompact
->read('mo/nl.mo', charset => 'utf-8')
or die;
my $header = $pot->msgid('');
print $mot->msgstr($msgid, 3);
DESCRIPTION
This module is translating, based on MO files (binary versions of the PO files, the ``Machine Object'' format)Internally, this module tries to be as efficient as possible: high speed and low memory foot-print. You will not be able to sub-class this class cleanly.
To get a MO file, you first need a PO file. Then run msgfmt, which is part of the gnu gettext package.
msgfmt -cv -o $domain.mo $domain.po # -c = --check-format & --check-header & --check-domain # -v = --verbose # -o = --output-file
Extends ``DESCRIPTION'' in Log::Report::Lexicon::Table.
METHODS
Extends ``METHODS'' in Log::Report::Lexicon::Table.Constructors
Extends ``Constructors'' in Log::Report::Lexicon::Table.- Log::Report::Lexicon::MOTcompact->new(%options)
- Inherited, see ``Constructors'' in Log::Report::Lexicon::Table
- Log::Report::Lexicon::MOTcompact->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
Extends ``Attributes'' in Log::Report::Lexicon::Table.- $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
Extends ``Managing PO's'' in Log::Report::Lexicon::Table.Translation
Extends ``Translation'' in Log::Report::Lexicon::Table.
- $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
Extends ``Administration'' in Log::Report::Lexicon::Table.
- $obj->add($po)
- Inherited, see ``Administration'' in Log::Report::Lexicon::Table
- $obj->header($field)
- Inherited, see ``Administration'' in Log::Report::Lexicon::Table
- $obj->nrPlurals()
- Inherited, see ``Administration'' in Log::Report::Lexicon::Table
- $obj->pluralIndex($count)
- Inherited, see ``Administration'' in Log::Report::Lexicon::Table
- $obj->setupPluralAlgorithm()
- Inherited, see ``Administration'' in Log::Report::Lexicon::Table
- $obj->translations( [$active] )
- Inherited, see ``Administration'' in Log::Report::Lexicon::Table
DIAGNOSTICS
- Error: only acceptable parameter is 'ACTIVE'
LICENSE
Copyrights 2007-2016 by [Mark Overmeer]. 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://www.perl.com/perl/misc/Artistic.html