The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Locale::Maketext::Lexicon - Use other catalog formats in Maketext

VERSION

This document describes version 0.02 of Locale::Maketext::Lexicon, released May 13, 2002.

SYNOPSIS

As part of a localization class:

    package Hello::L10N;
    use base 'Locale::Maketext';
    use Locale::Maketext::Lexicon {de => [Gettext => 'hello_de.po']};

Alternatively, as part of a localization subclass:

    package Hello::L10N::de;
    use base 'Hello::L10N';
    use Locale::Maketext::Lexicon;
    Locale::Maketext::Lexicon->import(Gettext => \*DATA);
    __DATA__
    # Some sample data
    msgid ""
    msgstr ""
    "Project-Id-Version: Hello 1.3.22.1\n"
    "MIME-Version: 1.0\n"
    "Content-Type: text/plain; charset=iso8859-1\n"
    "Content-Transfer-Encoding: 8bit\n"

    #: Hello.pm:10
    msgid "Hello, World!"
    msgstr "Hallo, Welt!"

DESCRIPTION

This module provides lexicon-handling modules to read from other localization formats, such as Gettext, Msgcat, and so on.

The import() function accepts two forms of arguments:

(format, [ filehandle | filename | arrayref ])

This form pass the contents specified by the second argument to Locale::Maketext::Plugin::format->parse as a plain list, and export its return value as the %Lexicon hash in the calling package.

{ language => format, [ filehandle | filename | arrayref ] ... }

This form accepts a hash reference. It will export a %Lexicon into the subclasses specified by each language, using the process described above. It is designed to alleviate the need to set up a separate subclass for each localized language, and just use the catalog files.

ACKNOWLEDGEMENTS

Thanks to Jesse Vincent for suggesting this function, and Sean M Burke for coming up with Locale::Maketext in the first place.

SEE ALSO

Locale::Maketext, Locale::Maketext::Lexicon::Gettext

AUTHORS

Autrijus Tang <autrijus@autrijus.org>

COPYRIGHT

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