diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2012-11-14 18:09:02 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-15 13:55:00 +0100 |
commit | e4c2a5c29f78def39801d8f2ea12b954594f7e7d (patch) | |
tree | 78c3749c98ed937c3b3ddde0b67e2376ae6b0bdf /util/local_database/cldr2qlocalexml.py | |
parent | 1e0e5f2d68f58843d900467eea6981b5a28244f5 (diff) |
Assign correct codes to QLocale::AnyCountry and AnyScript
as their meaning, in fact, is unknown (or default) country/script.
Change-Id: Id75a70d4b33c2092de414f3ac357f6bcb627ba47
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'util/local_database/cldr2qlocalexml.py')
-rwxr-xr-x | util/local_database/cldr2qlocalexml.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/util/local_database/cldr2qlocalexml.py b/util/local_database/cldr2qlocalexml.py index e5accece74..2ad41cbec9 100755 --- a/util/local_database/cldr2qlocalexml.py +++ b/util/local_database/cldr2qlocalexml.py @@ -135,26 +135,22 @@ def generateLocaleInfo(path): return {} language_id = enumdata.languageCodeToId(language_code) - if language_id == -1: + if language_id <= 0: sys.stderr.write("unknown language code \"" + language_code + "\"\n") return {} language = enumdata.language_list[language_id][0] script_id = enumdata.scriptCodeToId(script_code) - if script_code == -1: + if script_id == -1: sys.stderr.write("unknown script code \"" + script_code + "\"\n") return {} - script = "AnyScript" - if script_id != -1: - script = enumdata.script_list[script_id][0] + script = enumdata.script_list[script_id][0] country_id = enumdata.countryCodeToId(country_code) - country = "" - if country_id != -1: - country = enumdata.country_list[country_id][0] - if country == "": + if country_id <= 0: sys.stderr.write("unknown country code \"" + country_code + "\"\n") return {} + country = enumdata.country_list[country_id][0] # So we say we accept only those values that have "contributed" or # "approved" resolution. see http://www.unicode.org/cldr/process.html |