Add support for numbered territories in CLDR
The CLDR data contains eight locales with numeric territory codes, 001 for World, 150 for Europe and 419 for Latin America. The last was already known in our enumdata.py, but as "Latin America and The Caribbean", which is not supported by the CLDR, so I've amended it while adding the other two. This gives us support for Esperanto and Yiddish (among others). [ChangeLog][QtCore][QLocale] Added support for World and Europe as (numeric) "country" codes ("territory" in CLDR terms), thereby enabling support for Yiddish and Esperanto, among other locales using such codes. Task-number: QTBUG-57802 Change-Id: Ibb1180fb720743a3a0589527649d10f3c9cd123d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
fd38c97a6c
commit
44b6757fe5
@ -851,7 +851,7 @@ public:
|
||||
Serbia = 243,
|
||||
SaintBarthelemy = 244,
|
||||
SaintMartin = 245,
|
||||
LatinAmericaAndTheCaribbean = 246,
|
||||
LatinAmerica = 246,
|
||||
AscensionIsland = 247,
|
||||
AlandIslands = 248,
|
||||
DiegoGarcia = 249,
|
||||
@ -865,6 +865,8 @@ public:
|
||||
Kosovo = 257,
|
||||
EuropeanUnion = 258,
|
||||
OutlyingOceania = 259,
|
||||
World = 260,
|
||||
Europe = 261,
|
||||
|
||||
Tokelau = TokelauCountry,
|
||||
Tuvalu = TuvaluCountry,
|
||||
@ -874,8 +876,9 @@ public:
|
||||
RepublicOfKorea = SouthKorea,
|
||||
RussianFederation = Russia,
|
||||
SyrianArabRepublic = Syria,
|
||||
LatinAmericaAndTheCaribbean = LatinAmerica,
|
||||
|
||||
LastCountry = OutlyingOceania
|
||||
LastCountry = Europe
|
||||
};
|
||||
// GENERATED PART ENDS HERE
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -299,8 +299,8 @@ void tst_QLocale::defaulted_ctor()
|
||||
|
||||
TEST_CTOR(French, France, QLocale::French, QLocale::France)
|
||||
TEST_CTOR(C, France, QLocale::C, QLocale::AnyCountry)
|
||||
TEST_CTOR(Spanish, LatinAmericaAndTheCaribbean, QLocale::Spanish,
|
||||
QLocale::LatinAmericaAndTheCaribbean)
|
||||
TEST_CTOR(Spanish, LatinAmerica, QLocale::Spanish,
|
||||
QLocale::LatinAmerica)
|
||||
|
||||
QLocale::setDefault(QLocale(QLocale::English, QLocale::France));
|
||||
|
||||
@ -428,6 +428,8 @@ void tst_QLocale::defaulted_ctor()
|
||||
TEST_CTOR("en_GB@bla", English, UnitedKingdom)
|
||||
TEST_CTOR("en-GB", English, UnitedKingdom)
|
||||
TEST_CTOR("en-GB@bla", English, UnitedKingdom)
|
||||
TEST_CTOR("eo", Esperanto, World)
|
||||
TEST_CTOR("yi", Yiddish, World)
|
||||
|
||||
QVERIFY(QLocale::Norwegian == QLocale::NorwegianBokmal);
|
||||
TEST_CTOR("no", Norwegian, Norway)
|
||||
@ -437,8 +439,8 @@ void tst_QLocale::defaulted_ctor()
|
||||
TEST_CTOR("nb_NO", Norwegian, Norway)
|
||||
TEST_CTOR("nn_NO", NorwegianNynorsk, Norway)
|
||||
TEST_CTOR("es_ES", Spanish, Spain)
|
||||
TEST_CTOR("es_419", Spanish, LatinAmericaAndTheCaribbean)
|
||||
TEST_CTOR("es-419", Spanish, LatinAmericaAndTheCaribbean)
|
||||
TEST_CTOR("es_419", Spanish, LatinAmerica)
|
||||
TEST_CTOR("es-419", Spanish, LatinAmerica)
|
||||
TEST_CTOR("fr_MA", French, Morocco)
|
||||
|
||||
// test default countries for languages
|
||||
|
@ -29,7 +29,8 @@
|
||||
|
||||
# language_list and country_list reflect the current values of enums in qlocale.h
|
||||
# If new xml language files are available in CLDR, these languages and countries
|
||||
# need to be *appended* to this list.
|
||||
# need to be *appended* to this list (for compatibility between versions).
|
||||
### Qt 6: restore alphabetic order in each list.
|
||||
|
||||
language_list = {
|
||||
0 : [ "AnyLanguage", " " ],
|
||||
@ -641,7 +642,7 @@ country_list = {
|
||||
243 : [ "Serbia", "RS" ],
|
||||
244 : [ "Saint Barthelemy", "BL" ],
|
||||
245 : [ "Saint Martin", "MF" ],
|
||||
246 : [ "LatinAmericaAndTheCaribbean", "419" ],
|
||||
246 : [ "Latin America", "419" ],
|
||||
247 : [ "AscensionIsland", "AC" ],
|
||||
248 : [ "AlandIslands", "AX" ],
|
||||
249 : [ "DiegoGarcia", "DG" ],
|
||||
@ -654,7 +655,9 @@ country_list = {
|
||||
256 : [ "SintMaarten", "SX" ],
|
||||
257 : [ "Kosovo", "XK" ],
|
||||
258 : [ "European Union", "EU" ],
|
||||
259 : [ "Outlying Oceania", "QO" ]
|
||||
259 : [ "Outlying Oceania", "QO" ],
|
||||
260 : [ "World", "001" ],
|
||||
261 : [ "Europe", "150" ]
|
||||
}
|
||||
|
||||
script_list = {
|
||||
|
@ -809,6 +809,7 @@ def main():
|
||||
qlocaleh_temp_file.write(" RepublicOfKorea = SouthKorea,\n")
|
||||
qlocaleh_temp_file.write(" RussianFederation = Russia,\n")
|
||||
qlocaleh_temp_file.write(" SyrianArabRepublic = Syria,\n")
|
||||
qlocaleh_temp_file.write(" LatinAmericaAndTheCaribbean = LatinAmerica,\n")
|
||||
qlocaleh_temp_file.write("\n")
|
||||
qlocaleh_temp_file.write(" LastCountry = " + country + "\n")
|
||||
qlocaleh_temp_file.write(" };\n")
|
||||
|
Loading…
Reference in New Issue
Block a user