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?


In reply to getting Locale::TextDomain working by mla12

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.