I've created some packs of svg flag icons for the language indicator menu. I'm expanding it now, and have had a request for a flag for the "Latin American" layout of Spanish. But I can't figure out what two-character filename is linked to that layout. It's not ES (for spanish) and this list of language codes doesn't seem to include anything that fits. Does anyone know what the two-character code is for the Latin American layout?
There is not one-to-one correlation between languages, countries, and keyboard layouts.
Some languages are associated with multiple keyboard layouts, e.g. English: USA and United Kingdom. Some keyboard layouts are associated with multiple languages, e.g. Kazakhstan: Kazakh and Russian. Many keyboard layouts are associated with multiple countries, e.g. Latin American…
The Latin American (
latam) keyboard layout is associated with all of the following countries:
and the following languages:
So in this case, you are lucky. Latin American is only associated with one language. "es" is your two-letter language code.
That aside, I would recommend against using language codes to indicate keyboard layouts. There is a separate system already in place for abbreviating the names of the layouts themselves. See
shortDescription in xkb-data's
There are two distinctive things here:
Languages (and codes for them).
Language codes have some international standards as monotasker referenced. There's no such thing in these standards as "Latin American" or something similar, because there is no such a language. Apart from Brazilian Portugese, Latin Americans speak some variation(s) of Spanish, and the code for Spanish as a language is clear.
Keyboard layouts (and codes for them).
On the other hand, when talking about keyboard layouts, I highly suspect that there's no international standard code for them. Operating systems, distros and even some applications, prefer something of their choice as far as I can see. Mostly they are similar to the language codes, but for the variants, naming varies to taste, to some extent. To see what GNOME, Ubuntu or the default applications we use prefer as an abbreviation for Latin American keyboard layout, I added it to my Ubuntu 10.10 via System -> Preferences >- Keyboard -> Layout -> Add > By country via Argaetina or by language via Spanish lets say > Latin American. Then the Indicator Applet appeared on the GNOME Panel and it prefers the abbreviation LAm for the Latin American layout. So you may prefer the same to be consistent with the mainstream GNOME, Ubuntu preference, or you may prefer something else.