Mailing List Archive

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
Re: I18N fallback to i-default [ In reply to ]
From: "Ton Voon" <ton.voon@opsera.com>
> 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@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
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@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev