What is the two-character language code for the Latin American keyboard layout?
Solution 1
From the base.xml "source" file:
<name>latam</name>
I suspect that's what you need.
Solution 2
ES
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:
-
AR
,BO
,CL
,CO
,CR
,CU
,DO
,EC
,GT
,HN
,HT
,MX
,NI
,PA
,PE
,PR
,PY
,SV
,US
,UY
,VE
and the following languages:
spa
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 base.xml
.
Related videos on Youtube
monotasker
Updated on September 17, 2022Comments
-
monotasker over 1 year
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?
(If you're interested, the flag packs are posted on Gnome Look: seperately for dark panels and for light panels).
-
monotasker over 13 yearsHmmmm. What I'm trying to do is figure out what filename to use for a flag image for the language indicator. In most cases the indicator looks for an image file with the name of the language's two-character code (not the country-code but the language code). Spanish, for example, is ES. Arabic is AR. US English is US. I expected the Latin American layout to use the spanish flag image (ES), but it doesn't. So it's really not a matter of what code I choose to use.
-
monotasker over 13 yearsRight. What is confusing here is that the Ubuntu language indicator seems to look for flag-image filenames based on a two-character code and these codes oscillate between being codes for a language (es, ar) and being codes for a country (us, il). They don't correspond to the three-character codes that the indicator outputs if you have flags turned off.
-
monotasker over 13 yearsThanks, yes! After your suggestion I also found it in the base.lst file. Thanks again.
-
marenostrum over 13 yearsI downloaded the XKeyboardConfig software's latest source (2.0) from here and in Symbols directory in it, for example, there's a file named latam. Even if its a 5-charecter abbreviation, it seems to act at the same level with some 2-charecter abbreviations. So, technically, programs seem to refer to that layout as latam. Then, their way of expression in GUI to the user may be different I think, as in the example of Indicator Applet's LAm So, maybe JanC has given the correct answer at the very beginning.
-
marenostrum over 13 yearsAs mentioned in some other answers and comments, focusing on latam might be usefull. And apart from that, Spanish Flag image is not suitable for Latin American layout. I don't know what you will create for it but it shouldn't be a national flag, Spanish flag being the most irrelevant. At least, Spain is not even in Americas.
-
JanC over 13 yearsThe layout's short description, “LAm”, is what the keyboard layout indicator icon for Ubuntu 11.04 will use as text (it won't be country flags!), the filename will be latam.png or latam.svg or something like that, so based on the layout name.