diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2011-03-29 10:50:24 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2011-03-29 15:18:07 (GMT) |
commit | 7590288fd6419159116f4392389cb8ca9691fb06 (patch) | |
tree | d38121cbb3bb2ea41cbdc7b1b2ae97f3875f7aec /util/local_database/qlocalexml2cpp.py | |
parent | 335fdd66947adadcdaaeb2896c42fba28d67843a (diff) | |
download | Qt-7590288fd6419159116f4392389cb8ca9691fb06.zip Qt-7590288fd6419159116f4392389cb8ca9691fb06.tar.gz Qt-7590288fd6419159116f4392389cb8ca9691fb06.tar.bz2 |
Added native language and country names (endonyms) to QLocale.
Task-number: QTBUG-17092
Reviewed-by: Zeno Albisser
Reviewed-by: Liang Qi
Diffstat (limited to 'util/local_database/qlocalexml2cpp.py')
-rwxr-xr-x | util/local_database/qlocalexml2cpp.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/util/local_database/qlocalexml2cpp.py b/util/local_database/qlocalexml2cpp.py index f16ecbf..8907435 100755 --- a/util/local_database/qlocalexml2cpp.py +++ b/util/local_database/qlocalexml2cpp.py @@ -237,8 +237,10 @@ def assertSingleChar(string): class Locale: def __init__(self, elt): self.language = eltText(firstChildElt(elt, "language")) + self.languageEndonym = eltText(firstChildElt(elt, "languageEndonym")) self.script = eltText(firstChildElt(elt, "script")) self.country = eltText(firstChildElt(elt, "country")) + self.countryEndonym = eltText(firstChildElt(elt, "countryEndonym")) self.decimal = int(eltText(firstChildElt(elt, "decimal"))) self.group = int(eltText(firstChildElt(elt, "group"))) self.listDelim = int(eltText(firstChildElt(elt, "list"))) @@ -509,6 +511,7 @@ def main(): currency_symbol_data = StringData() currency_display_name_data = StringData() currency_format_data = StringData() + endonyms_data = StringData() # Locale data data_temp_file.write("static const QLocalePrivate locale_data[] = {\n") @@ -521,7 +524,7 @@ def main(): for key in locale_keys: l = locale_map[key] - data_temp_file.write(" { %6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s, {%s}, %s,%s,%s,%s,%6d,%6d,%6d,%6d,%6d }, // %s/%s/%s\n" \ + data_temp_file.write(" { %6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%6d,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s, {%s}, %s,%s,%s,%s,%s,%s,%6d,%6d,%6d,%6d,%6d }, // %s/%s/%s\n" \ % (key[0], key[1], key[2], l.decimal, l.group, @@ -562,6 +565,8 @@ def main(): currency_display_name_data.append(l.currencyDisplayName), currency_format_data.append(l.currencyFormat), currency_format_data.append(l.currencyNegativeFormat), + endonyms_data.append(l.languageEndonym), + endonyms_data.append(l.countryEndonym), l.currencyDigits, l.currencyRounding, l.firstDayOfWeek, @@ -570,7 +575,7 @@ def main(): l.language, l.script, l.country)) - data_temp_file.write(" { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, {0,0,0}, 0,0, 0,0, 0,0, 0,0, 0, 0, 0, 0, 0 } // trailing 0s\n") + data_temp_file.write(" { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, {0,0,0}, 0,0, 0,0, 0,0, 0,0, 0, 0, 0, 0, 0, 0,0, 0,0 } // trailing 0s\n") data_temp_file.write("};\n") data_temp_file.write("\n") @@ -661,6 +666,12 @@ def main(): data_temp_file.write(wrap_list(currency_format_data.data)) data_temp_file.write("\n};\n") + # Endonyms data + #check_static_char_array_length("endonyms", endonyms_data.data) + data_temp_file.write("static const ushort endonyms_data[] = {\n") + data_temp_file.write(wrap_list(endonyms_data.data)) + data_temp_file.write("\n};\n") + data_temp_file.write("\n") # Language name list |