[PATCH 2/2] Use sr_Latn or sr at latin as needed (#866730)
Vratislav Podzimek
vpodzime at redhat.com
Fri Nov 2 22:48:15 UTC 2012
babel needs sr_Latn to display "Serbian (Latin)", but the valid
locale is sr at 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 at Latn.UTF-8": "sr_RS.UTF-8 at 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",
--
1.7.11.7
More information about the anaconda-patches
mailing list