summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2012-11-02 09:12:10 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-10 03:11:00 +0100
commit8a7bab8f497a777335814e3a3bdc78b10732f57a (patch)
tree274637d61dc9686d72453389c4ac30575d176a4c /util
parent8c67684ababc2a81f9cdd552eea90ab8accfc6b0 (diff)
Update Qlocale data with CLDR 2.0.0
Change-Id: Ia5adad0b51a8db6e91ad60288eab67e506c19e47 Reviewed-by: Mehdi Fekari <mfekari@rim.com> Reviewed-by: Denis Dzyubenko <denis@ddenis.info> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'util')
-rw-r--r--util/local_database/enumdata.py23
-rwxr-xr-xutil/local_database/qlocalexml2cpp.py1
-rw-r--r--util/local_database/xpathlite.py42
3 files changed, 59 insertions, 7 deletions
diff --git a/util/local_database/enumdata.py b/util/local_database/enumdata.py
index 5f51acb4d0..1af862ed71 100644
--- a/util/local_database/enumdata.py
+++ b/util/local_database/enumdata.py
@@ -113,7 +113,7 @@ language_list = {
65 : [ "Kirghiz", "ky" ],
66 : [ "Korean", "ko" ],
67 : [ "Kurdish", "ku" ],
- 68 : [ "Kurundi", "rn" ],
+ 68 : [ "Rundi", "rn" ],
69 : [ "Laothian", "lo" ],
70 : [ "Latin", "la" ],
71 : [ "Latvian", "lv" ],
@@ -260,7 +260,26 @@ language_list = {
212 : [ "Central Morocco Tamazight", "tzm" ],
213 : [ "Koyraboro Senni", "ses" ],
214 : [ "Shambala", "ksb" ],
- 215 : [ "Bodo", "brx" ]
+ 215 : [ "Bodo", "brx" ],
+ 216 : [ "Aghem", "agq" ],
+ 217 : [ "Basaa", "bas" ],
+ 218 : [ "Zarma", "dje" ],
+ 219 : [ "Duala", "dua" ],
+ 220 : [ "JolaFonyi", "dyo" ],
+ 221 : [ "Ewondo", "ewo" ],
+ 222 : [ "Bafia", "ksf" ],
+ 223 : [ "LubaKatanga", "lu" ],
+ 224 : [ "MakhuwaMeetto", "mgh" ],
+ 225 : [ "Mundang", "mua" ],
+ 226 : [ "Kwasio", "nmg" ],
+ 227 : [ "Nuer", "nus" ],
+ 228 : [ "Sakha", "sah" ],
+ 229 : [ "Sangu", "sbp" ],
+ 230 : [ "Congo Swahili", "swc" ],
+ 231 : [ "Tasawaq", "twq" ],
+ 232 : [ "Vai", "vai" ],
+ 233 : [ "Walser", "wae" ],
+ 234 : [ "Yangben", "yav" ]
}
country_list = {
diff --git a/util/local_database/qlocalexml2cpp.py b/util/local_database/qlocalexml2cpp.py
index edf311c42e..566195a925 100755
--- a/util/local_database/qlocalexml2cpp.py
+++ b/util/local_database/qlocalexml2cpp.py
@@ -816,6 +816,7 @@ def main():
# special cases for norwegian. we really need to make it right at some point.
qlocaleh_temp_file.write(" NorwegianBokmal = Norwegian,\n")
qlocaleh_temp_file.write(" NorwegianNynorsk = Nynorsk,\n")
+ qlocaleh_temp_file.write(" Kurundi = Rundi,\n")
qlocaleh_temp_file.write(" LastLanguage = " + language + "\n")
qlocaleh_temp_file.write(" };\n")
diff --git a/util/local_database/xpathlite.py b/util/local_database/xpathlite.py
index 1706b31ebd..d7cd0089cb 100644
--- a/util/local_database/xpathlite.py
+++ b/util/local_database/xpathlite.py
@@ -178,7 +178,11 @@ def _findEntryInFile(file, path, draft=None, attribute=None):
if elt.attributes.has_key(attribute):
return (elt.attributes[attribute].nodeValue, None)
return (None, None)
- return (elt.firstChild.nodeValue, None)
+ try:
+ return (elt.firstChild.nodeValue, None)
+ except:
+ pass
+ return (None, None)
def findAlias(file):
if not doc_cache.has_key(file):
@@ -191,6 +195,36 @@ def findAlias(file):
return False
return alias_elt.attributes['source'].nodeValue
+parent_locales = {}
+def _fixedLookupChain(dirname, name):
+ # see http://www.unicode.org/reports/tr35/#Parent_Locales
+ if not parent_locales:
+ for ns in findTagsInFile(dirname + "/../supplemental/supplementalData.xml", "parentLocales"):
+ tmp = {}
+ parent_locale = ""
+ for data in ns[1:][0]: # ns looks like this: [u'parentLocale', [(u'parent', u'root'), (u'locales', u'az_Cyrl bs_Cyrl en_Dsrt ..')]]
+ tmp[data[0]] = data[1]
+ if data[0] == u"parent":
+ parent_locale = data[1]
+ parent_locales[parent_locale] = tmp[u"locales"].split(" ")
+
+ items = name.split("_")
+ # split locale name into items and iterate through them from back to front
+ # example: az_Latn_AZ => [az_Latn_AZ, az_Latn, az]
+ items = list(reversed(map(lambda x: "_".join(items[:x+1]), range(len(items)))))
+
+ for i in range(len(items)):
+ item = items[i]
+ for parent_locale in parent_locales.keys():
+ for locale in parent_locales[parent_locale]:
+ if item == locale:
+ if parent_locale == u"root":
+ items = items[:i+1]
+ else:
+ items = items[:i+1] + parent_locale.split() + items[i+1:]
+ return items
+ return items
+
def _findEntry(base, path, draft=None, attribute=None):
file = base
if base.endswith(".xml"):
@@ -199,10 +233,8 @@ def _findEntry(base, path, draft=None, attribute=None):
else:
file = base + ".xml"
(dirname, filename) = os.path.split(base)
- items = filename.split("_")
- # split locale name into items and iterate through them from back to front
- # example: az_Latn_AZ => [az_Latn_AZ, az_Latn, az]
- items = reversed(map(lambda x: "_".join(items[:x+1]), range(len(items))))
+
+ items = _fixedLookupChain(dirname, filename)
for item in items:
file = dirname + "/" + item + ".xml"
if os.path.isfile(file):