https://bugzilla.redhat.com/show_bug.cgi?id=1133188
Mike FABIAN mfabian@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(mfabian@redhat.co | |m) |
--- Comment #23 from Mike FABIAN mfabian@redhat.com --- (In reply to Ankit Patel from comment #17)
- What's the purpose of this component (langtable)?
--> As per README file,
"""""""" Purpose of this package =======================
langtable is used to guess reasonable defaults for locale, keyboard, territory, …, if part of that information is already known. For example, guess the territory and the keyboard layout if the language is known or guess the language and keyboard layout if the territory is already known. """"""""
Anaconda uses it to list the possible locales for a language or the possible locales for a territory. Like this:
$ python3 Python 3.3.2 (default, Jun 30 2014, 17:20:03) [GCC 4.8.3 20140624 (Red Hat 4.8.3-1)] on linux Type "help", "copyright", "credits" or "license" for more information.
import langtable langtable.list_locales(languageId='ta')
['ta_IN.UTF-8', 'ta_LK.UTF-8']
langtable.list_locales(territoryId='IN')
['en_IN.UTF-8', 'hi_IN.UTF-8', 'bn_IN.UTF-8', 'te_IN.UTF-8', 'mr_IN.UTF-8', 'ta_IN.UTF-8', 'ur_IN.UTF-8', 'gu_IN.UTF-8', 'kn_IN.UTF-8', 'ml_IN.UTF-8', 'or_IN.UTF-8', 'pa_IN.UTF-8', 'as_IN.UTF-8', 'mai_IN.UTF-8', 'sat_IN.UTF-8', 'ks_IN.UTF-8', 'ks_IN.UTF-8@devanagari', 'kok_IN.UTF-8', 'sd_IN.UTF-8', 'sd_IN.UTF-8@devanagari', 'doi_IN.UTF-8', 'mni_IN.UTF-8', 'brx_IN.UTF-8', 'bho_IN.UTF-8', 'bo_IN.UTF-8', 'hne_IN.UTF-8', 'mag_IN.UTF-8', 'ar_IN.UTF-8']
The results are ordered according to what seems most likely.
For example when asking what locales are possible for German, one gets:
langtable.list_locales(languageId='de')
['de_DE.UTF-8', 'de_AT.UTF-8', 'de_CH.UTF-8', 'de_BE.UTF-8', 'de_LU.UTF-8']
The first is de_DE.UTF-8 because Germany (DE) is the biggest German speaking country.
If one knows that the country is Switzerland (CH) one gets:
langtable.list_locales(territoryId='CH')
['de_CH.UTF-8', 'fr_CH.UTF-8', 'it_CH.UTF-8', 'wae_CH.UTF-8']
So German is the most common language in Switzerland followed by French.
If one knows both the country and the language the result is often unique, but not always:
langtable.list_locales(languageId='sr', territoryId='RS')
['sr_RS.UTF-8', 'sr_RS.UTF-8@latin']
So for Serbian in Serbia we have two results because Serbian can be written both in Cyrillic script (sr_RS.UTF-8) or in Latin script (sr_RS.UTF-8@latin).
To make Tamil the default if the installation is done in Tamilnadu, probably an API extension is needed.
We need to check what geoip actually returns when the IP is from Tamilnadu. Does it return the state? Or a city? Or latitude and longitude? All of this? The country “IN” alone is not enough to decide. So if geoip returns more information than just “IN”, I can probably add data to langtable and extend the API a bit to use this additional information to get a more precise result of the most common locale for that location.
But with the current state of langtable, we have have to choose which language should be the default one for all of India.
The other languages returned by langtable.list_locales(territoryId='IN') are still shown by Anaconda right next to the first one in the list, but the first one is selected by default.
i18n-bugs@lists.fedoraproject.org