Locale::Maketext::Lexicon is a Perl module to use other catalog formats in Maketext.
SYNOPSIS
As part of a localization class, automatically glob for available lexicons:
package Hello::I18N;
use base 'Locale::Maketext';
use Locale::Maketext::Lexicon {
'*' => [Gettext => '/usr/local/share/locale/*/LC_MESSAGES/hello.mo'],
### Uncomment to decode lexicon entries into Unicode strings
# _decode => 1,
### Uncomment to fallback when a key is missing from lexicons
# _auto => 1,
### Uncomment to use %1 / %quant(%1) instead of [_1] / [quant, _1]
# _style => 'gettext',
};
Explicitly specify languages, during compile- or run-time:
package Hello::I18N;
use base 'Locale::Maketext';
use Locale::Maketext::Lexicon {
de => [Gettext => 'hello_de.po'],
fr => [
Gettext => 'hello_fr.po',
Gettext => 'local/hello/fr.po',
],
};
# ... incrementally add new lexicons
Locale::Maketext::Lexicon->import({
de => [Gettext => 'local/hello/de.po'],
})
Alternatively, as part of a localization subclass:
package Hello::I18N::de;
use base 'Hello::I18N';
use Locale::Maketext::Lexicon (Gettext => *DATA);
__DATA__
# Some sample data
msgid ""
msgstr ""
"Project-Id-Version: Hello 1.3.22.1n"
"MIME-Version: 1.0n"
"Content-Type: text/plain; charset=iso8859-1n"
"Content-Transfer-Encoding: 8bitn"
#: Hello.pm:10
msgid "Hello, World!"
msgstr "Hallo, Welt!"
#: Hello.pm:11
msgid "You have %quant(%1,piece) of mail."
msgstr "Sie haben %quant(%1,Poststueck,Poststuecken)."
This module provides lexicon-handling modules to read from other localization formats, such as Gettext, Msgcat, and so on.
If you are unfamiliar with the concept of lexicon modules, please consult Locale::Maketext and http://www.autrijus.org/webl10n/ first.
A command-line utility xgettext.pl is also installed with this module, for extracting translatable strings from source files.
Product's homepage
Requirements:
· Perl