Comment 22 for bug 408474

On 01/11/2011 07:41 AM, Gunnar Hjalmarsson wrote:
> The proposed code for @variants is general, and intended to be applied
> to all translation variants. What Pau suggests would require special
> code just for @valencia. Technically it would of course be possible (and
> not very difficult), but I fear that such a hack wouldn't be approved
> for policy reasons.

Actually, I think we can improve this without having special code only
for @valencia, since all @variations would be affected. (see below)

> Pau: It's a little ironic that you use GNOME to support your suggestion.
> Please check out the discussion at
> https://bugzilla.gnome.org/show_bug.cgi?id=602965 to see what I mean.
> ;-) My code is part of the work with bug 693337, and it will probably
> become an Ubuntu only solution.
>
> It may be worth mentioning that GDM and language-selector use different
> methods for converting code to menu labels. In language-selector the
> language code 'ca' is shown as 'Catalan; Valencian' and in GDM as just
> 'Catalan'.

Yep. The language/country names and their translations in
language-selector are taken from the iso-codes packages, i.e. they are
the names defined in ISO639-1,2,3 and ISO3166 respectively. In GDM on
the other hand the language/country names are hard coded, means the
translations in both applications would be done separately and may
conflict with each other, since they are two different upstreams.

Since the @variations are not standardized in the iso-codes package, and
I couldn't think of a "proper" solution which would work for all
@variations, I did it like this in language-selector: the identifier
behind @ in the locale name is chopped off and glued to the (translated)
language name in the format "language[ (country)][ - variant]", where
country and variant are optional. This also means, the variant name
currently cannot be translated.

Now, the proper solution would probably be something like this:
 * a "text" file with a mapping between language codes, whose names and
translations need to override the ones from iso-codes
 * this file needs to be parsed and be translatable
 * it should be possible to use the same source for multiple programs
(gdm, language-selector, ...)

One solution I could think of is this:
We create a new package, "iso-codes-overrides" or something like that.
It contains a xml file in the same format as the iso639 or iso639-3 file
in the iso-codes package, where we have the following fields:
 id="ca@valencia"
 name="Catalan (Valencia)" (or something similar)
 comment="Catalan dialect spoken in Valencia" (a text comment for
translators to let them know what this entry is about)

Then we just need to steal^Wcopy the packaging scripts from the
iso-codes package to make the file translatable. This will then show up
as a translatable package in Launchpad.
Of course this solution would be probably Ubuntu (and maybe debian)
only. The next step would be to replace the hard coded language/country
names in gdm with gettext calls to our new package and the iso-codes
package, in this order. In language-selector we would just need to
insert and additional gettext call.

These overrides would IMHO affect the following language codes/locales:
aa_ER@saaho (should actually be 'ssy': Saaho, spoken in Eritrea,
compared to Afar, spoken in Ethiopia.)
be_BY@latin (Belorussian in Latin script, instead of Cyrillic)
ca (Catalan, instead of "Catalan; Valencian")
ca_ES (Catalan (Spain), instead of "Catalan; Valencian (Spain)")
ca@valencia (Catalan (Valencian))
ca_ES@valencia (Catalan (Valencian) -- no need to include the country
name here)
gez_ER@abegede (extinct language, don't need to bother about it)
gez_ET@abegede (extinct language, don't need to bother about it)
ks_IN@devanagari (Kashmiri in Devanagari Script instead of Arabic)
nan_TW@latin (Minnan in Latin script, instead of Han script)
sd_IN@devanagari (Sindhi in Devanagari script, instead of Arabic)
sr_RS@latin (Serbian in Latin script, instead of Cyrillic)
tt_RU@iqtelif (Tatar in iQTElif (Latin) script, instead of Cyrillic)
uz_UZ@cyrillic (Uzbek in Cyrillic script, instead of Latin)
zh-hans (Simplified Chinese -- used as language-pack identifier in
language-selector) -> would eliminate the hack in language-selector
zh-hant (Traditional Chinese -- used as language-pack identifier in
language-selector) -> would eliminate the hack in language-selector

Cheers
Arne
--
Arne Götje (高盛華) <email address hidden>
PGP/GnuPG key: 1024D/685D1E8C
Fingerprint: 2056 F6B7 DEA8 B478 311F 1C34 6E9F D06E 685D 1E8C
Key available at wwwkeys.pgp.net. Encrypted e-mail preferred.