diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2012-11-02 06:32:32 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-10 02:10:56 (GMT) |
commit | 8c67684ababc2a81f9cdd552eea90ab8accfc6b0 (patch) | |
tree | f21bac6918d2c579b078188c3b171b3b228e80bc /util | |
parent | fbf8ae9f390c2d482bb5dadf654942aae171f3df (diff) | |
download | Qt-8c67684ababc2a81f9cdd552eea90ab8accfc6b0.zip Qt-8c67684ababc2a81f9cdd552eea90ab8accfc6b0.tar.gz Qt-8c67684ababc2a81f9cdd552eea90ab8accfc6b0.tar.bz2 |
Update Qlocale data with CLDR 1.9.1
this is the same data we have in Qt 5 right now.
Change-Id: Ic4cea4fdde2001432f33b0cb658508756cc9e8d3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
Diffstat (limited to 'util')
-rwxr-xr-x | util/local_database/cldr2qlocalexml.py | 24 | ||||
-rw-r--r-- | util/local_database/enumdata.py | 3 |
2 files changed, 24 insertions, 3 deletions
diff --git a/util/local_database/cldr2qlocalexml.py b/util/local_database/cldr2qlocalexml.py index b2b5df6..e5accec 100755 --- a/util/local_database/cldr2qlocalexml.py +++ b/util/local_database/cldr2qlocalexml.py @@ -209,13 +209,33 @@ def generateLocaleInfo(path): try: return findEntry(path, xpath + "[numberSystem=" + numbering_system + "]") except xpathlite.Error: - pass + # in CLDR 1.9 number system was refactored for numbers (but not for currency) + # so if previous findEntry doesn't work we should try this: + try: + return findEntry(path, xpath.replace("/symbols/", "/symbols[numberSystem=" + numbering_system + "]/")) + except xpathlite.Error: + # fallback to default + pass return findEntry(path, xpath) + result['decimal'] = get_number_in_system(path, "numbers/symbols/decimal", numbering_system) result['group'] = get_number_in_system(path, "numbers/symbols/group", numbering_system) result['list'] = get_number_in_system(path, "numbers/symbols/list", numbering_system) result['percent'] = get_number_in_system(path, "numbers/symbols/percentSign", numbering_system) - result['zero'] = get_number_in_system(path, "numbers/symbols/nativeZeroDigit", numbering_system) + try: + numbering_systems = {} + for ns in findTagsInFile(cldr_dir + "/../supplemental/numberingSystems.xml", "numberingSystems"): + tmp = {} + id = "" + for data in ns[1:][0]: # ns looks like this: [u'numberingSystem', [(u'digits', u'0123456789'), (u'type', u'numeric'), (u'id', u'latn')]] + tmp[data[0]] = data[1] + if data[0] == u"id": + id = data[1] + numbering_systems[id] = tmp + result['zero'] = numbering_systems[numbering_system][u"digits"][0] + except e: + sys.stderr.write("Native zero detection problem:\n" + str(e) + "\n") + result['zero'] = get_number_in_system(path, "numbers/symbols/nativeZeroDigit", numbering_system) result['minus'] = get_number_in_system(path, "numbers/symbols/minusSign", numbering_system) result['plus'] = get_number_in_system(path, "numbers/symbols/plusSign", numbering_system) result['exp'] = get_number_in_system(path, "numbers/symbols/exponential", numbering_system).lower() diff --git a/util/local_database/enumdata.py b/util/local_database/enumdata.py index 78fc4d0..5f51acb 100644 --- a/util/local_database/enumdata.py +++ b/util/local_database/enumdata.py @@ -259,7 +259,8 @@ language_list = { 211 : [ "Chiga", "cgg" ], 212 : [ "Central Morocco Tamazight", "tzm" ], 213 : [ "Koyraboro Senni", "ses" ], - 214 : [ "Shambala", "ksb" ] + 214 : [ "Shambala", "ksb" ], + 215 : [ "Bodo", "brx" ] } country_list = { |