On 07/27/2011 09:35 AM, Anders Sundman wrote:


Andreas Schwab<sch...@linux-m68k.org>  wrote:

Anders Sundman<and...@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   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Reply via email to