Message Catalogs -- looking for usable module

Hi all,

I'm looking for an usable perl module that supports message catalogs.
On CPAN, I found the following modules:
- i18n
- Locale::TextDomain

I would like to combine the usage of the message catalogs with
Log::Log4perl.
Has anybody experience with the usage of these modules? Which one
would you recommend? Are there any better practices?

Thank you for your support,

Lubos
llavicka [ Mi, 30 Mai 2007 18:24 ] [ ID #1726517 ]

Re: Message Catalogs -- looking for usable module

On 30 May 2007 09:24:49 -0700, llavicka wrote:

> I'm looking for an usable perl module that supports message catalogs.
> On CPAN, I found the following modules:
> - i18n
> - Locale::TextDomain

Locale::TextDomain works fine for us here. Just put

use Locale::TextDomain 'appname', undef;

at the top of your scripts and call gettext() or it's short cut __().
You definitely want to take a look at __x() which is the function you want
to use to interpolate values into messages.

Using Locale::TextDomain you are able to extract the messages with
xgettext this way:

xgettext --keyword=__ --keyword=__x --language=perl --from-code=utf-8 \
-o appname.pot -f list_of_files_to_extract_messages_from

--
Gregor Goldbach (PKI Team), DFN-CERT Services GmbH, Phone: +49 40 808077-621

DFN-CERT Services GmbH, https://www.dfn-cert.de, Phone +49 40 808077-555
Sitz / Register: Hamburg, AG Hamburg, HRB 88805, Ust-IdNr.: DE 232129737
Gregor Goldbach [ Do, 31 Mai 2007 08:14 ] [ ID #1727461 ]
Perl » comp.lang.perl.modules » Message Catalogs -- looking for usable module

Vorheriges Thema: Search for a job online from command line
Nächstes Thema: Help Eventlog Perl Script