[Dancer-users] Problem with Dancer::Plugin::I18N

igor.bujna at post.cz igor.bujna at post.cz
Mon Mar 5 04:32:29 CET 2012

I make now version 0.22 which repair this problem via disabling for now test 01_basic.tt. 

> ------------ Původní zpráva ------------
> Od: sawyer x <xsawyerx at gmail.com>
> Předmět: Re: [Dancer-users] Problem with Dancer::Plugin::I18N
> Datum: 04.3.2012 07:10:07
> ----------------------------------------
> Hey,
> On Thu, Mar 1, 2012 at 4:39 PM, Daniel Montenegro <
> daniel.montenegro at surhive.com> wrote:
> > Hi, I can't install Dancer::Plugin::I18N with cpanm command. Maybe this
> > error is easy to avoid with a little work on the tests but I'm new in this
> > and I don't know what to do.
> >

 I send email to Daniel acknowledgements for reporting this problem.

> This seems like a problem with the test file itself. I've emailed Franck
> regarding this.
> You can meanwhile install it while ignoring the tests.
> Sorry about that.

Problem is in test 01_basic.tt  which can't run subs in Locale::Maketext::Simple and I fix latter because I'm in vacations.

> Apparently this module wasn't released to CPAN, and Igor Bujna has written
> another such module (unfortunately confusingly with the same name as this
> one), which is available on CPAN. Try and give it a whirl and see how it
> works for you:
> https://metacpan.org/module/Dancer::Plugin::I18N
> Franck or I will try and fix this module and perhaps upload it to CPAN
> under a different name.

Franck's module is some problems:
1) his module name is Dancer::Plugin::I18n which can confuse in name, because standart is I18N and he some use i18n next I18n :) 
2) his module only used Locale::Maketext  and my module is similar to Catalyst::Plugin::I18N. when use Locale::Maketext::Simple and for translations you can use *.po|.mo|.pm files. For me is better use for translation *.po or better *.mo files. For now I not tested  localization via *.pm files and I want to add this test.
3) I extend subs for better use in template like <% IF language_tag('en') %> or definition own sub name for localization like N_()...

Next version I want add calling func loc_lang+loc with extend calling this name like is in Catalyst::Plugin::I18N avoid print warning when Dancer start.

Next version I want to add automaticaly calling setlocale(...) for defined category in settings such like:
    setlocale: "LC_TIME"

and when is changed language than plugin set thys localization:
    setlocale(setings->{setlocale}, $lang . "." . $charset);

If you have some decision how to change or fix this module please send me patch or email and I make this fix

Bye Igor

> Hope this helps,
> Sawyer.
> Details: http://paste.perldancer.org/plain/2i8JsagFXjxtT
> >
> P.S.,
> Thank you for the detailed output! It makes it possible to fix it easily.

More information about the Dancer-users mailing list