Locale::Maketext::Lexicon::Gettext - Gettext catalog parser for Maketext
Called via Locale::Maketext::Lexicon:
package Hello::L10N; use base 'Locale::Maketext'; use Locale::Maketext::Lexicon {de => [Gettext => 'hello_de.po']};
Directly calling parse():
parse()
use Locale::Maketext::Lexicon::Gettext; my %Lexicon = Locale::Maketext::Lexicon::Gettext->parse(<DATA>); __DATA__ #: Hello.pm:10 msgid "Hello, World!" msgstr "Hallo, Welt!"
This module implements a perl-based Gettext parser for Locale::Maketext. It transforms all %1, %2... sequences to [_1], [_2], and so on.
Gettext
%1
%2
[_1]
[_2]
As an additional feature, this module also parses MIME-header style metadata specified in the null msgstr (""), and add them to the %Lexicon with a __ prefix. For example, the example above will set __Content-Type to text/plain; charset=iso8859-1, without the newline or the colon.
""
%Lexicon
__
__Content-Type
text/plain; charset=iso8859-1
Any normal entry that duplicates a metadata entry takes precedence. Hence, a msgid "__Content-Type" line occurs anywhere should override the above value.
msgid "__Content-Type"
Locale::Maketext, Locale::Maketext::Lexicon
Autrijus Tang <autrijus@autrijus.org>
Copyright 2002 by Autrijus Tang <autrijus@autrijus.org>.
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
To install Locale::Maketext::Lexicon, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Locale::Maketext::Lexicon
CPAN shell
perl -MCPAN -e shell install Locale::Maketext::Lexicon
For more information on module installation, please visit the detailed CPAN module installation guide.