summaryrefslogtreecommitdiffstats
path: root/Tools/i18n/makelocalealias.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-26 19:20:59 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-26 19:20:59 (GMT)
commit5eb01530b2bfba81b09e5129caabeada2d8dc487 (patch)
tree760252a550a56feb0acda78bd3aaf50bc1364872 /Tools/i18n/makelocalealias.py
parentd97c01ff2897a1d706b13d3684f8db69c8ea2ef3 (diff)
downloadcpython-5eb01530b2bfba81b09e5129caabeada2d8dc487.zip
cpython-5eb01530b2bfba81b09e5129caabeada2d8dc487.tar.gz
cpython-5eb01530b2bfba81b09e5129caabeada2d8dc487.tar.bz2
Issue #20027: Fixed locale aliases for devanagari locales.
Diffstat (limited to 'Tools/i18n/makelocalealias.py')
-rw-r--r--Tools/i18n/makelocalealias.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Tools/i18n/makelocalealias.py b/Tools/i18n/makelocalealias.py
index 3445ec8..8b92ae1 100644
--- a/Tools/i18n/makelocalealias.py
+++ b/Tools/i18n/makelocalealias.py
@@ -23,6 +23,12 @@ def parse(filename):
if line[:1] == '#':
continue
locale, alias = line.split()
+ # Fix non-standard locale names, e.g. ks_IN@devanagari.UTF-8
+ if '@' in alias:
+ alias_lang, _, alias_mod = alias.partition('@')
+ if '.' in alias_mod:
+ alias_mod, _, alias_enc = alias_mod.partition('.')
+ alias = alias_lang + '.' + alias_enc + '@' + alias_mod
# Strip ':'
if locale[-1] == ':':
locale = locale[:-1]