From bd7dd9744bb966ea0ff9c6a2ac3c7a4bfa485225 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 18 Feb 2011 15:25:11 +0100 Subject: In the generated locale data add the version info automatically. Reviewed-by: Zeno Albisser --- util/local_database/cldr2qlocalexml.py | 7 +++++++ util/local_database/qlocalexml2cpp.py | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/local_database/cldr2qlocalexml.py b/util/local_database/cldr2qlocalexml.py index 311cf4e02e..b873565c3e 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 "" +print " " + cldr_version + "" print " " 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 db549a6608..edae39cf62 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\ -- cgit v1.2.3