These are two patches proposed in the bugreport. Applying them fixes the issues with some languages, namely Serbian in variant sr@latin. Please see the last few comments in the bugreport for more information.
I'm not sure we really want something like that, but it fixes the reported issues. For F19 we will use a different solution without the mangle maps.
Vratislav Podzimek (2): Some more stuff for the mangleMap (#866730) Use sr_Latn or sr@latin as needed (#866730)
pyanaconda/localization.py | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-)
This is only for F18, we really need a better solution for the future. --- pyanaconda/localization.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/pyanaconda/localization.py b/pyanaconda/localization.py index c343888..e2b28d3 100644 --- a/pyanaconda/localization.py +++ b/pyanaconda/localization.py @@ -102,22 +102,24 @@ class LocaleInfo(object):
def mangleLocale(inLocale): mangleMap = {"af": "af_ZA", "am": "am_ET", "ar": "ar_SA", "as": "as_IN", - "ast": "ast_ES", "bg": "bg_BG", "bn": "bn_BD", "ca": "ca_ES", - "cs": "cs_CZ", "cy": "cy_GB", "da": "da_DK", "de": "de_DE", - "el": "el_GR", "en": "en_US", "es": "es_ES", "et": "et_EE", - "fa": "fa_IR", "fi": "fi_FI", "fr": "fr_FR", "gl": "gl_ES", - "gu": "gu_IN", "he": "he_IL", "hi": "hi_IN", "hr": "hr_HR", - "hu": "hu_HU", "id": "id_ID", "ilo": "ilo_PH", "is": "is_IS", - "it": "it_IT", "ja": "ja_JP", "kk": "kk_KZ", "kn": "kn_IN", - "ko": "ko_KR", "lt": "lt_LT", "lv": "lv_LV", "mai": "mai_IN", - "mk": "mk_MK", "ml": "ml_IN", "mr": "mr_IN", "ms": "ms_MY", - "nb": "nb_NO", "nds": "nds_DE", "ne": "ne_NP", "nl": "nl_NL", - "nn": "nn_NO", "nso": "nso_ZA", "or": "or_IN", "pa": "pa_IN", - "pl": "pl_PL", "pt": "pt_PT", "ro": "ro_RO", "ru": "ru_RU", - "si": "si_LK", "sk": "sk_SK", "sl": "sl_SI", "sq": "sq_AL", - "sr": "sr_RS", "sv": "sv_SE", "ta": "ta_IN", "te": "te_IN", - "tg": "tg_TJ", "th": "th_TH", "tr": "tr_TR", "uk": "uk_UA", - "ur": "ur_PK", "vi": "vi_VN", "zu": "zu_ZA"} + "ast": "ast_ES", "be": "be_BY", "bg": "bg_BG", "bn": "bn_BD", + "bs": "bs_BA", "ca": "ca_ES", "cs": "cs_CZ", "cy": "cy_GB", + "da": "da_DK", "de": "de_DE", "el": "el_GR", "en": "en_US", + "es": "es_ES", "et": "et_EE", "eu": "eu_ES", "fa": "fa_IR", + "fi": "fi_FI", "fr": "fr_FR", "gl": "gl_ES", "gu": "gu_IN", + "he": "he_IL", "hi": "hi_IN", "hr": "hr_HR", "hu": "hu_HU", + "hy": "hy_AM", "id": "id_ID", "ilo": "ilo_PH", "is": "is_IS", + "it": "it_IT", "ja": "ja_JP", "ka": "ka_GE", "kk": "kk_KZ", + "kn": "kn_IN", "ko": "ko_KR", "lt": "lt_LT", "lv": "lv_LV", + "mai": "mai_IN", "mk": "mk_MK", "ml": "ml_IN", "mr": "mr_IN", + "ms": "ms_MY", "nb": "nb_NO", "nds": "nds_DE", "ne": "ne_NP", + "nl": "nl_NL", "nn": "nn_NO", "nso": "nso_ZA", "or": "or_IN", + "pa": "pa_IN", "pl": "pl_PL", "pt": "pt_PT", "ro": "ro_RO", + "ru": "ru_RU", "si": "si_LK", "sk": "sk_SK", "sl": "sl_SI", + "sq": "sq_AL", "sr": "sr_RS", "sr@latin": "sr_Latn", + "sv": "sv_SE", "ta": "ta_IN", "te": "te_IN", "tg": "tg_TJ", + "th": "th_TH", "tr": "tr_TR", "uk": "uk_UA", "ur": "ur_PK", + "vi": "vi_VN", "zu": "zu_ZA"}
return mangleMap.get(inLocale, inLocale)
babel needs sr_Latn to display "Serbian (Latin)", but the valid locale is sr@latin. --- pyanaconda/localization.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/localization.py b/pyanaconda/localization.py index e2b28d3..c5a05f1 100644 --- a/pyanaconda/localization.py +++ b/pyanaconda/localization.py @@ -89,7 +89,7 @@ class LocaleInfo(object): # add enconding suffix langcode = langcode + ".UTF-8"
- return langcode + return mangleRepr(langcode)
def __str__(self): return self.english_name.encode('ascii', 'replace') @@ -100,6 +100,12 @@ class LocaleInfo(object): def __eq__(self, other): return repr(self) == repr(other)
+def mangleRepr(inRepr): + mangleReprMap = {"sr@Latn.UTF-8": "sr_RS.UTF-8@latin" + } + + return mangleReprMap.get(inRepr, inRepr) + def mangleLocale(inLocale): mangleMap = {"af": "af_ZA", "am": "am_ET", "ar": "ar_SA", "as": "as_IN", "ast": "ast_ES", "be": "be_BY", "bg": "bg_BG", "bn": "bn_BD",
anaconda-patches@lists.fedorahosted.org