[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gettext] Translations under a language's main dialect are not found
From: |
Bruno Haible |
Subject: |
Re: [gettext] Translations under a language's main dialect are not found if LANGUAGE contains only the language code |
Date: |
Wed, 9 Mar 2011 22:00:53 +0100 |
User-agent: |
KMail/1.9.9 |
Hi,
Gunnar Hjalmarsson wrote:
> [ resending this with the gettext address instead of
> address@hidden Don't know if it matters, considering that the
> lists are archived together. ]
Sure it matters. bug-gnu-gettext, bug-sed, bug-gawk, bug-diff have different
subscribers, but the archive is shared.
> gettext does not behave in accordance with this para in section 2.3.3
> of the gettext docs:
> "In the `LANGUAGE' environment variable, but not in the other
> environment variables, `LL_CC' combinations can be abbreviated as `LL'
> to denote the language's main dialect. For example, `de' is equivalent
> to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
> (Portuguese as spoken in Portugal) in this context."
>
> This is how I reached that conclusion:
>
> $ cat mytest.po
> msgid "myTestWord\n"
> msgstr "meinTestWort\n"
> $ sudo msgfmt mytest.po -o /usr/share/locale/de_DE/LC_MESSAGES/mytest.mo
Yes, of course if you create a translation that you declare as being valid
only for "German as spoken in Germany" then a user that merely asks for
a "German" translation will not see yours.
Hardly anyone does that:
$ find /usr/share/locale -type f -name '*.mo' | wc -l
3359
$ for d in de_DE el_GR es_ES et_EE fi_FI fr_FR it_IT nb_NO nn_NO pl_PL sl_SI
sq_AL uk_UA
do
find /usr/share/locale/$d -type f
done
/usr/share/locale/el_GR/LC_MESSAGES/zypp.mo
/usr/share/locale/el_GR/LC_MESSAGES/power-management.mo
/usr/share/locale/et_EE/LC_MESSAGES/net-tools.mo
/usr/share/locale/sl_SI/LC_MESSAGES/zypp.mo
/usr/share/locale/sl_SI/LC_MESSAGES/cracklib.mo
/usr/share/locale/sl_SI/LC_MESSAGES/power-management.mo
/usr/share/locale/uk_UA/LC_MESSAGES/tcsh
Most probably these 7 message catalogs were put there by translators who
did not know that they should omit the country designation, since their
language has only one single main country. I have now reported the problem
for the first 6 among these; the 7th one is not even a GNU message catalog.
The documentation section is for end-users. This is not a reference manual,
therefore slight simplifications and reasonable real-life assumptions are
appropriate here.
Bruno
--
In memoriam Otto Freundlich <http://en.wikipedia.org/wiki/Otto_Freundlich>