|
From: | Eric Blake |
Subject: | Re: Fallback language for internationalized string |
Date: | Wed, 27 Jul 2011 09:52:40 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11 |
On 07/27/2011 09:35 AM, Anders Sundman wrote:
Andreas Schwab<schwab@linux-m68k.org> wrote:Anders Sundman<anders@4zm.org> writes:Is it possible to get bash to use a fallback language for showing localized strings if no translation exists for the current language? Instead of using the 'raw' msgid that is.The msgid is supossed to be the fallback. That's how gettext works.There are unfortunately two problems with this. I was hoping that a specific language fallback would fix them. 1. If you try to use the same msgid twice in a script you get an error when extracting it.
Why? It should be possible to use the same msgid twice, if you are okay using the same translation twice.
> Using the same human readable string twice is however a valid use case. So using 'wierd' (e.g. numbered) msgids make sense. But you don't ever want the user to see this.
If you want weird msgids that are not usable directly, then your code must do a comparison after the translation. If the translation resulted in the msgid, then you use your sane fallback; if it resulted in a different string, then you got a translation.
2. If you use en strings as msgids and you later have to fix a simple spelling error for en, then all translation files have to be modified.
Yes, but gettext provides tools to make that modification easy. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |