summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2011-02-18 14:25:11 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2011-02-18 16:14:42 (GMT)
commitbd7dd9744bb966ea0ff9c6a2ac3c7a4bfa485225 (patch)
treefa945c733c653135faf428c3b4b81af3f3f7bbeb /util
parente0f3dc3ecedb220e5bfa6a54c7c06ef4d371bcc4 (diff)
downloadQt-bd7dd9744bb966ea0ff9c6a2ac3c7a4bfa485225.zip
Qt-bd7dd9744bb966ea0ff9c6a2ac3c7a4bfa485225.tar.gz
Qt-bd7dd9744bb966ea0ff9c6a2ac3c7a4bfa485225.tar.bz2
In the generated locale data add the version info automatically.
Reviewed-by: Zeno Albisser
Diffstat (limited to 'util')
-rwxr-xr-xutil/local_database/cldr2qlocalexml.py7
-rwxr-xr-xutil/local_database/qlocalexml2cpp.py3
2 files changed, 9 insertions, 1 deletions
diff --git a/util/local_database/cldr2qlocalexml.py b/util/local_database/cldr2qlocalexml.py
index 311cf4e..b873565 100755
--- a/util/local_database/cldr2qlocalexml.py
+++ b/util/local_database/cldr2qlocalexml.py
@@ -455,7 +455,14 @@ integrateWeekData(cldr_dir+"/../supplemental/supplementalData.xml")
locale_keys = locale_database.keys()
locale_keys.sort()
+cldr_version = 'unknown'
+ldml = open(cldr_dir+"/../dtd/ldml.dtd", "r")
+for line in ldml:
+ if 'version cldrVersion CDATA #FIXED' in line:
+ cldr_version = line.split('"')[1]
+
print "<localeDatabase>"
+print " <version>" + cldr_version + "</version>"
print " <languageList>"
for id in enumdata.language_list:
l = enumdata.language_list[id]
diff --git a/util/local_database/qlocalexml2cpp.py b/util/local_database/qlocalexml2cpp.py
index db549a6..edae39c 100755
--- a/util/local_database/qlocalexml2cpp.py
+++ b/util/local_database/qlocalexml2cpp.py
@@ -388,7 +388,8 @@ def main():
locale_map = loadLocaleMap(doc, language_map, country_map)
dupes = findDupes(language_map, country_map)
- cldr_version = "1.8.1"
+ cldr_version = eltText(firstChildElt(doc.documentElement, "version"))
+
data_temp_file.write("\n\
/*\n\
This part of the file was generated on %s from the\n\