mla12 has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to localize a module. I'm using Locale::TextDomain and Dist::Zilla::LocalTextDomain to manage it.
The module is available at https://github.com/mla/time-ago
I've added a French translation but I can't seem to trigger the translation.
I'm following this tutorial: http://perladvent.org/2013/2013-12-09.html
Compiling of the .po files seems to work fine:
$ dzil msg-compile po/fr.po [LocaleTextDomain] po/fr.po: 9 translated messages, 2 untranslated mes +sages.
But then I try to test it using the example from the tutorial, and I get English:
$ LANGUAGE=fr perl -Ilib -CAS -I. ./try about 3 hours
Here's the script:
#!/usr/bin/env perl use strict; use Time::Ago; print Time::Ago->in_words(3600 * 3.2), "\n";
Here's the .po translation that should apply there:
#: lib/Time/Ago.pm:47 #, perl-brace-format msgid "about {count} hour" msgid_plural "about {count} hours" msgstr[0] "environ une heure" msgstr[1] "environ {count} heures"
What am I missing?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: getting Locale::TextDomain working
by Anonymous Monk on Jul 08, 2015 at 08:53 UTC | |
by mla12 (Acolyte) on Jul 08, 2015 at 19:16 UTC | |
by mla12 (Acolyte) on Jul 18, 2015 at 19:50 UTC |