Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Dev

I18N fallback to i-default

 

 

Catalyst dev RSS feed   Index | Next | Previous | View Threaded


ton.voon at opsera

Jul 6, 2009, 2:13 AM

Post #1 of 3 (1688 views)
Permalink
I18N fallback to i-default

Hi!

As part of internationalisation for Opsview (http://opsview.org), I've
come across a limitation in the lookup of translated messages.

We've decided to use arbitrary keys as the message keys, rather than
the English text, but i-default (http://www.iana.org/assignments/lang-tags/i-default
) is not used by Maketext as the basis for all other languages, so we
get web pages that say "ui.messages.hostIsDown", rather than the
fallback English translation.

After a lot of debugging through, I've found this is a limitation of
Locale::Maketext::Simple, which Catalyst::Plugin::I18N uses.

The patch for Locale::Maketext::Simple is raised here: https://rt.cpan.org/Ticket/Display.html?id=47609

I've attached a patch to the tests in Catalyst::Plugin::I18N with a
tarball containing an i_default.po file which demonstrates the problem.

Is this a valid and/or useful?

Ton
Attachments: catalyst_plugin_i18n_test.patch (1.60 KB)
  catalyst_plugin_i18n_test.tar (10.0 KB)


orasnita at gmail

Jul 6, 2009, 2:43 AM

Post #2 of 3 (1566 views)
Permalink
Re: I18N fallback to i-default [In reply to]

From: "Ton Voon" <ton.voon [at] opsera>
> Hi!
>
> As part of internationalisation for Opsview (http://opsview.org), I've
> come across a limitation in the lookup of translated messages.
>
> We've decided to use arbitrary keys as the message keys, rather than
> the English text, but i-default
> (http://www.iana.org/assignments/lang-tags/i-default
> ) is not used by Maketext as the basis for all other languages, so we
> get web pages that say "ui.messages.hostIsDown", rather than the
> fallback English translation.
>
> After a lot of debugging through, I've found this is a limitation of
> Locale::Maketext::Simple, which Catalyst::Plugin::I18N uses.
>
> The patch for Locale::Maketext::Simple is raised here:
> https://rt.cpan.org/Ticket/Display.html?id=47609
>
> I've attached a patch to the tests in Catalyst::Plugin::I18N with a
> tarball containing an i_default.po file which demonstrates the problem.
>
> Is this a valid and/or useful?
>
> Ton

I don't know if this fixes the same issue I had some time ago, but if it
does, it is really helpful.

I've also used some short keys in the .po files instead of a long message,
like:

msgid "message1"
msgstr ""
"Here is\n"
"The message\n"
"that should be translated"

or

msgid "message1"
msgstr "A message with [_1] parameters [_2]"

But the translated messages weren't translated as it should.

Octavian






_______________________________________________
Catalyst-dev mailing list
Catalyst-dev [at] lists
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


bobtfish at bobtfish

Jul 6, 2009, 2:41 PM

Post #3 of 3 (1551 views)
Permalink
Re: I18N fallback to i-default [In reply to]

On 6 Jul 2009, at 10:13, Ton Voon wrote:
> Is this a valid and/or useful?

Yes. It's on github...

http://github.com/bobtfish/locale-maketext-simple/commit/
cafa15ec43fb8ba7ed8ad7c4e8ea198fd38cc196

Hope that's ok.

I've sent a pull request, you may also want to link that in the
relevant RT and/or fork it and change the attribution if you'd prefer
something else to what I wrote :)

Cheers
t0m


_______________________________________________
Catalyst-dev mailing list
Catalyst-dev [at] lists
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev

Catalyst dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.