Purge deprecated language and country codes from QLocale

Requires subsequent re-numbering of the enum tables to eliminate gaps,
before locale data can be regenerated. However, it will work with the
present locale data, since it merely loses the means to use some names
for which the available data was just the name and code. This implies
a transient issue of recognising some codes for which there is no
actual enum member; but relevant code will work as before, finding
nothing but the code and its name. This shall be resolved by a coming
BiC change to resort the language, country and script codes, changing
the numbering (almost) completely.

[ChangeLog][QtCore][QLocale] Various obsolete language and country
codes have been removed. Some lacked locale data, others were obsolete
aliases. All have been deprecated in 5.15.

Task-number: QTBUG-84669
Change-Id: I45fc76a5f2f6c3b0ea3c1bb61e917da984183783
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Edward Welbourne 2020-10-20 13:58:42 +02:00 committed by Volker Hilsheimer
parent 60d804c567
commit 3a1bc4bad5
4 changed files with 0 additions and 231 deletions

View File

@ -92,9 +92,6 @@ public:
Basque = 14,
Bengali = 15,
Dzongkha = 16,
#if QT_DEPRECATED_SINCE(5, 15)
Bihari Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 17,
#endif
Bislama = 18,
Breton = 19,
Bulgarian = 20,
@ -327,9 +324,6 @@ public:
Nuer = 247,
Sakha = 248,
Sangu = 249,
#if QT_DEPRECATED_SINCE(5, 15)
CongoSwahili Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 250,
#endif
Tasawaq = 251,
Vai = 252,
Walser = 253,
@ -349,69 +343,21 @@ public:
Bamun = 267,
BatakToba = 268,
Buginese = 269,
#if QT_DEPRECATED_SINCE(5, 15)
Buhid Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 270,
Carian Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 271,
#endif
Chakma = 272,
#if QT_DEPRECATED_SINCE(5, 15)
ClassicalMandaic Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 273,
#endif
Coptic = 274,
Dogri = 275,
#if QT_DEPRECATED_SINCE(5, 15)
EasternCham Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 276,
EasternKayah Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 277,
Etruscan Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 278,
#endif
Gothic = 279,
#if QT_DEPRECATED_SINCE(5, 15)
Hanunoo Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 280,
#endif
Ingush = 281,
#if QT_DEPRECATED_SINCE(5, 15)
LargeFloweryMiao Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 282,
Lepcha Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 283,
Limbu Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 284,
Lisu Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 285,
Lu Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 286,
Lycian Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 287,
Lydian Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 288,
#endif
Mandingo = 289,
Manipuri = 290,
#if QT_DEPRECATED_SINCE(5, 15)
Meroitic Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 291,
NorthernThai Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 292,
#endif
OldIrish = 293,
OldNorse = 294,
OldPersian = 295,
#if QT_DEPRECATED_SINCE(5, 15)
OldTurkish Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 296,
#endif
Pahlavi = 297,
#if QT_DEPRECATED_SINCE(5, 15)
Parthian Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 298,
#endif
Phoenician = 299,
#if QT_DEPRECATED_SINCE(5, 15)
PrakritLanguage Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 300,
Rejang Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 301,
Sabaean Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 302,
Samaritan Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 303,
#endif
Santali = 304,
Saurashtra = 305,
#if QT_DEPRECATED_SINCE(5, 15)
Sora Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 306,
Sylheti Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 307,
Tagbanwa Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 308,
#endif
TaiDam = 309,
#if QT_DEPRECATED_SINCE(5, 15)
TaiNua Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 310,
#endif
Ugaritic = 311,
Akoose = 312,
Lakota = 313,
@ -430,57 +376,22 @@ public:
InariSami = 326,
SkoltSami = 327,
Warlpiri = 328,
#if QT_DEPRECATED_SINCE(5, 15)
ManichaeanMiddlePersian Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 329,
#endif
Mende = 330,
#if QT_DEPRECATED_SINCE(5, 15)
AncientNorthArabian Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 331,
LinearA Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 332,
HmongNjua Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 333,
Ho Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 334,
#endif
Lezghian = 335,
#if QT_DEPRECATED_SINCE(5, 15)
Bassa Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 336,
Mono Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 337,
TedimChin Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 338,
#endif
Maithili = 339,
#if QT_DEPRECATED_SINCE(5, 15)
Ahom Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 340,
#endif
AmericanSignLanguage = 341,
#if QT_DEPRECATED_SINCE(5, 15)
ArdhamagadhiPrakrit Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 342,
#endif
Bhojpuri = 343,
#if QT_DEPRECATED_SINCE(5, 15)
HieroglyphicLuwian Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 344,
#endif
LiteraryChinese = 345,
Mazanderani = 346,
#if QT_DEPRECATED_SINCE(5, 15)
Mru Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 347,
#endif
Newari = 348,
NorthernLuri = 349,
Palauan = 350,
Papiamento = 351,
#if QT_DEPRECATED_SINCE(5, 15)
Saraiki Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 352,
#endif
TokelauLanguage = 353,
TokPisin = 354,
TuvaluLanguage = 355,
#if QT_DEPRECATED_SINCE(5, 15)
UncodedLanguages Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 356,
#endif
Cantonese = 357,
Osage = 358,
#if QT_DEPRECATED_SINCE(5, 15)
Tangut Q_DECL_ENUMERATOR_DEPRECATED_X("No locale data for this language") = 359,
#endif
Ido = 360,
Lojban = 361,
Sicilian = 362,
@ -500,16 +411,7 @@ public:
Chewa = Nyanja,
Frisian = WesternFrisian,
Kurundi = Rundi,
#if QT_DEPRECATED_SINCE(5, 15)
Moldavian Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use Romanian") = Romanian,
Norwegian Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use NorwegianBokmal") = NorwegianBokmal,
#endif
RhaetoRomance = Romansh,
#if QT_DEPRECATED_SINCE(5, 15)
SerboCroatian Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use Serbian") = Serbian,
Tagalog Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use Filipino") = Filipino,
Twi Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use Akan") = Akan,
#endif
Uigur = Uighur,
LastLanguage = NigerianPidgin
@ -936,10 +838,6 @@ public:
RepublicOfKorea = SouthKorea,
RussianFederation = Russia,
SyrianArabRepublic = Syria,
#if QT_DEPRECATED_SINCE(5, 15)
Tokelau Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use TokelauCountry") = TokelauCountry,
Tuvalu Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use TuvaluCountry") = TuvaluCountry,
#endif
LastCountry = Europe
};

View File

@ -111,7 +111,6 @@
\value Afar
\value Afrikaans
\value Aghem
\value Ahom Obsolete, no locale data available
\value Akan
\value Akkadian Since Qt 5.1
\value Akoose Since Qt 5.3
@ -120,11 +119,9 @@
\value Amharic
\value AncientEgyptian Since Qt 5.1
\value AncientGreek Since Qt 5.1
\value AncientNorthArabian Obsolete, no locale data available
\value Arabic
\value Aragonese Since Qt 5.1
\value Aramaic Since Qt 5.1
\value ArdhamagadhiPrakrit Obsolete, no locale data available
\value Armenian
\value Assamese
\value Asturian
@ -141,7 +138,6 @@
\value Basaa
\value Bashkir
\value Basque
\value Bassa Obsolete, no locale data available
\value BatakToba Since Qt 5.1
\value Belarusian
\value Bemba
@ -149,20 +145,17 @@
\value Bengali
\value Bhojpuri Since Qt 5.7
\value Bhutani Obsolete, please use Dzongkha
\value Bihari Obsolete, no locale data available
\value Bislama
\value Blin
\value Bodo
\value Bosnian
\value Breton
\value Buginese Since Qt 5.1
\value Buhid Obsolete, no locale data available
\value Bulgarian
\value Burmese
\value Byelorussian Obsolete, please use Belarusian
\value Cambodian Obsolete, please use Khmer
\value Cantonese Since Qt 5.7
\value Carian Obsolete, no locale data available
\value Catalan
\value Cebuano Since Qt 5.14
\value CentralKurdish Since Qt 5.5
@ -177,9 +170,7 @@
\value Chinese (Mandarin)
\value Church
\value Chuvash
\value ClassicalMandaic Obsolete, no locale data available
\value Colognian
\value CongoSwahili Obsolete, no locale data available
\value Coptic Since Qt 5.1
\value Cornish
\value Corsican
@ -192,14 +183,12 @@
\value Duala
\value Dutch
\value Dzongkha
\value EasternCham Obsolete, no locale data available
\value EasternKayah Obsolete, no locale data available
\value Embu
\value English
\value Erzya Since Qt 5.14
\value Esperanto
\value Estonian
\value Etruscan Obsolete, no locale data available
\value Ewe
\value Ewondo
\value Faroese
@ -224,16 +213,12 @@
\value Gujarati
\value Gusii
\value Haitian
\value Hanunoo Obsolete, no locale data available
\value Hausa
\value Hawaiian
\value Hebrew
\value Herero
\value HieroglyphicLuwian Obsolete, no locale data available
\value Hindi
\value HiriMotu
\value HmongNjua Obsolete, no locale data available
\value Ho Obsolete, no locale data available
\value Hungarian
\value Icelandic
\value Ido Since Qt 5.12
@ -281,16 +266,11 @@
\value Lakota Since Qt 5.3
\value Langi
\value Lao
\value LargeFloweryMiao Obsolete, no locale data available
\value Latin
\value Latvian
\value Lepcha Obsolete, no locale data available
\value Lezghian Since Qt 5.5
\value Limburgish
\value Limbu Obsolete, no locale data available
\value LinearA Obsolete, no locale data available
\value Lingala
\value Lisu Obsolete, no locale data available
\value LiteraryChinese Since Qt 5.7
\value Lithuanian
\value Lojban Since Qt 5.12
@ -299,11 +279,8 @@
\value LubaKatanga
\value LuleSami Since Qt 5.5
\value Luo
\value Lu Obsolete, no locale data available
\value Luxembourgish
\value Luyia
\value Lycian Obsolete, no locale data available
\value Lydian Obsolete, no locale data available
\value Macedonian
\value Machame
\value Maithili Since Qt 5.5
@ -314,7 +291,6 @@
\value Malayalam
\value Maltese
\value Mandingo Since Qt 5.1
\value ManichaeanMiddlePersian Obsolete, no locale data available
\value Manipuri Since Qt 5.1
\value Manx
\value Maori
@ -324,15 +300,11 @@
\value Masai
\value Mazanderani Since Qt 5.7
\value Mende Since Qt 5.5
\value Meroitic Obsolete, no locale data available
\value Meru
\value Meta
\value Mohawk Since Qt 5.5
\value Moldavian Obsolete, please use Romanian
\value Mongolian
\value Mono Obsolete, no locale data available
\value Morisyen
\value Mru Obsolete, no locale data available
\value Mundang
\value Muscogee Since Qt 5.14
\value Nama
@ -347,11 +319,9 @@
\value NorthernLuri Since Qt 5.7
\value NorthernSami
\value NorthernSotho
\value NorthernThai Obsolete, no locale data available
\value NorthNdebele
\value NorwegianBokmal
\value NorwegianNynorsk
\value Norwegian Obsolete, please use NorwegianBokmal
\value Nuer
\value Nyanja
\value Nyankole
@ -360,7 +330,6 @@
\value OldIrish Since Qt 5.1
\value OldNorse Since Qt 5.1
\value OldPersian Since Qt 5.1
\value OldTurkish Obsolete, no locale data available
\value Oriya
\value Oromo
\value Osage Since Qt 5.7
@ -369,17 +338,14 @@
\value Palauan Since Qt 5.7
\value Pali
\value Papiamento Since Qt 5.7
\value Parthian Obsolete, no locale data available
\value Pashto
\value Persian
\value Phoenician Since Qt 5.1
\value Polish
\value Portuguese
\value PrakritLanguage Obsolete, no locale data available
\value Prussian Since Qt 5.5
\value Punjabi
\value Quechua
\value Rejang Obsolete, no locale data available
\value RhaetoRomance Obsolete, please use Romansh
\value Romanian
\value Romansh
@ -387,22 +353,18 @@
\value Rundi
\value Russian
\value Rwa
\value Sabaean Obsolete, no locale data available
\value Saho
\value Sakha
\value Samaritan Obsolete, no locale data available
\value Samburu
\value Samoan
\value Sango
\value Sangu
\value Sanskrit
\value Santali Since Qt 5.1
\value Saraiki Obsolete, no locale data available
\value Sardinian
\value Saurashtra Since Qt 5.1
\value Sena
\value Serbian
\value SerboCroatian Obsolete, please use Serbian
\value Shambala
\value Shona
\value SichuanYi
@ -416,7 +378,6 @@
\value Slovenian
\value Soga
\value Somali
\value Sora Obsolete, no locale data available
\value SouthernKurdish Since Qt 5.12
\value SouthernSami Since Qt 5.5
\value SouthernSotho
@ -428,22 +389,16 @@
\value Swati
\value Swedish
\value SwissGerman
\value Sylheti Obsolete, no locale data available
\value Syriac
\value Tachelhit
\value Tagalog Obsolete, please use Filipino
\value Tagbanwa Obsolete, no locale data available
\value Tahitian
\value TaiDam Since Qt 5.1
\value TaiNua Obsolete, no locale data available
\value Taita
\value Tajik
\value Tamil
\value Tangut Obsolete, no locale data available
\value Taroko
\value Tasawaq
\value Tatar
\value TedimChin Obsolete, no locale data available
\value Telugu
\value Teso
\value Thai
@ -458,13 +413,11 @@
\value Turkish
\value Turkmen
\value TuvaluLanguage Since Qt 5.7
\value Twi Obsolete, please use Akan
\value Tyap
\value Ugaritic Since Qt 5.1
\value Uighur
\value Uigur Obsolete, please use Uighur
\value Ukrainian
\value UncodedLanguages Obsolete, no locale data available
\value UpperSorbian Since Qt 5.5
\value Urdu
\value Uzbek
@ -742,7 +695,6 @@
\value Thailand
\value Togo
\value TokelauCountry
\value Tokelau Obsolete, please use TokelauCountry
\value Tonga
\value TrinidadAndTobago
\value TristanDaCunha
@ -751,7 +703,6 @@
\value Turkmenistan
\value TurksAndCaicosIslands
\value TuvaluCountry
\value Tuvalu Obsolete, please use TuvaluCountry
\value Uganda
\value Ukraine
\value UnitedArabEmirates

View File

@ -646,22 +646,6 @@ void tst_QLocale::legacyNames()
{
QLocale::setDefault(QLocale(QLocale::C));
#if QT_DEPRECATED_SINCE(5, 15)
#define TEST_CTOR(req_lang, req_country, exp_lang, exp_country) \
{ \
QLocale l(QLocale::req_lang, QLocale::req_country); \
QCOMPARE((int)l.language(), (int)QLocale::exp_lang); \
QCOMPARE((int)l.country(), (int)QLocale::exp_country); \
}
TEST_CTOR(Moldavian, Moldova, Romanian, Moldova)
TEST_CTOR(Norwegian, AnyCountry, Norwegian, Norway)
TEST_CTOR(SerboCroatian, Montenegro, Serbian, Montenegro)
TEST_CTOR(Tagalog, AnyCountry, Filipino, Philippines)
#undef TEST_CTOR
#endif
#define TEST_CTOR(req_lc, exp_lang, exp_country) \
{ \
QLocale l(req_lc); \
@ -2869,18 +2853,6 @@ void tst_QLocale::textDirection_data()
bool rightToLeft = false;
switch (language) {
// based on likelySubtags for RTL scripts
#if QT_DEPRECATED_SINCE(5, 15)
case QLocale::AncientNorthArabian:
case QLocale::ClassicalMandaic:
case QLocale::Lydian:
case QLocale::ManichaeanMiddlePersian:
case QLocale::Meroitic:
case QLocale::OldTurkish:
case QLocale::Parthian:
case QLocale::PrakritLanguage:
case QLocale::Sabaean:
case QLocale::Samaritan:
#endif
case QLocale::AncientGreek:
case QLocale::Arabic:
case QLocale::Aramaic:

View File

@ -61,7 +61,6 @@ language_list = {
14: ["Basque", "eu"],
15: ["Bengali", "bn"],
16: ["Dzongkha", "dz"],
17: ["Bihari", "bh"],
18: ["Bislama", "bi"],
19: ["Breton", "br"],
20: ["Bulgarian", "bg"],
@ -294,7 +293,6 @@ language_list = {
247: ["Nuer", "nus"],
248: ["Sakha", "sah"],
249: ["Sangu", "sbp"],
250: ["Congo Swahili", "swc"],
251: ["Tasawaq", "twq"],
252: ["Vai", "vai"],
253: ["Walser", "wae"],
@ -314,47 +312,21 @@ language_list = {
267: ["Bamun", "bax"],
268: ["Batak Toba", "bbc"],
269: ["Buginese", "bug"],
270: ["Buhid", "bku"],
271: ["Carian", "xcr"],
272: ["Chakma", "ccp"],
273: ["Classical Mandaic", "myz"],
274: ["Coptic", "cop"],
275: ["Dogri", "doi"], # macrolanguage
276: ["Eastern Cham", "cjm"],
277: ["Eastern Kayah", "eky"],
278: ["Etruscan", "ett"],
279: ["Gothic", "got"],
280: ["Hanunoo", "hnn"],
281: ["Ingush", "inh"],
282: ["Large Flowery Miao", "hmd"],
283: ["Lepcha", "lep"],
284: ["Limbu", "lif"],
285: ["Lisu", "lis"],
286: ["Lu", "khb"],
287: ["Lycian", "xlc"],
288: ["Lydian", "xld"],
289: ["Mandingo", "man"], # macrolanguage
290: ["Manipuri", "mni"],
291: ["Meroitic", "xmr"],
292: ["Northern Thai", "nod"],
293: ["Old Irish", "sga"],
294: ["Old Norse", "non"],
295: ["Old Persian", "peo"],
296: ["Old Turkish", "otk"],
297: ["Pahlavi", "pal"],
298: ["Parthian", "xpr"],
299: ["Phoenician", "phn"],
300: ["Prakrit Language", "pra"],
301: ["Rejang", "rej"],
302: ["Sabaean", "xsa"],
303: ["Samaritan", "smp"],
304: ["Santali", "sat"],
305: ["Saurashtra", "saz"],
306: ["Sora", "srb"],
307: ["Sylheti", "syl"],
308: ["Tagbanwa", "tbw"],
309: ["Tai Dam", "blt"],
310: ["Tai Nua", "tdd"],
311: ["Ugaritic", "uga"],
312: ["Akoose", "bss"],
313: ["Lakota", "lkt"],
@ -373,37 +345,22 @@ language_list = {
326: ["Inari Sami", "smn"],
327: ["Skolt Sami", "sms"],
328: ["Warlpiri", "wbp"],
329: ["Manichaean Middle Persian", "xmn"],
330: ["Mende", "men"],
331: ["Ancient North Arabian", "xna"],
332: ["Linear A", "lab"],
333: ["Hmong Njua", "hnj"],
334: ["Ho", "hoc"],
335: ["Lezghian", "lez"],
336: ["Bassa", "bsq"],
337: ["Mono", "mru"],
338: ["Tedim Chin", "ctd"],
339: ["Maithili", "mai"],
340: ["Ahom", "aho"],
341: ["American Sign Language", "ase"],
342: ["Ardhamagadhi Prakrit", "pka"],
343: ["Bhojpuri", "bho"],
344: ["Hieroglyphic Luwian", "hlu"],
345: ["Literary Chinese", "lzh"],
346: ["Mazanderani", "mzn"],
347: ["Mru", "mro"],
348: ["Newari", "new"],
349: ["Northern Luri", "lrc"],
350: ["Palauan", "pau"],
351: ["Papiamento", "pap"],
352: ["Saraiki", "skr"],
353: ["Tokelau", "tkl"],
354: ["Tok Pisin", "tpi"],
355: ["Tuvalu", "tvl"],
356: ["Uncoded Languages", "mis"],
357: ["Cantonese", "yue"],
358: ["Osage", "osa"],
359: ["Tangut", "txg"],
360: ["Ido", "io"],
361: ["Lojban", "jbo"],
362: ["Sicilian", "scn"],
@ -418,12 +375,6 @@ language_list = {
}
language_aliases = {
# Legacy - should disappear at some point:
'Norwegian': 'NorwegianBokmal',
'Moldavian': 'Romanian',
'SerboCroatian': 'Serbian',
'Tagalog': 'Filipino',
'Twi': 'Akan',
# Renamings:
'Afan': 'Oromo',
'Byelorussian': 'Belarusian',
@ -702,9 +653,6 @@ country_list = {
}
country_aliases = {
# Deprecated:
'Tokelau': 'TokelauCountry',
'Tuvalu': 'TuvaluCountry',
# Renamings:
'DemocraticRepublicOfCongo': 'CongoKinshasa',
'PeoplesRepublicOfCongo': 'CongoBrazzaville',