diff options
author | JiDe Zhang <zhangjide@uniontech.com> | 2021-03-09 16:19:54 +0800 |
---|---|---|
committer | JiDe Zhang <zhangjide@uniontech.com> | 2021-04-15 20:17:49 +0800 |
commit | 50a7eb8cf75a2f9cebde6d0d23c108e5e7f1870b (patch) | |
tree | c947e4746bb55f723c4005534cb98501f083036a /util/locale_database/cldr.py | |
parent | 7c8d45cb2635ab44d85d85288fd74ef72909264c (diff) |
Add the "Territory" enumerated type for QLocale
The use of "Country" is misleading as some entries in the enumeration
are not countries (eg, HongKong), for all that most are. The Unicode
Consortium's Common Locale Data Repository (CLDR, from which QLocale's
data is taken) calls these territories, so introduce territory-based
names and prepare to deprecate the country-based ones in due course.
[ChangeLog][QtCore][QLocale] QLocale now has Territory as an alias for
its Country enumeration, and associated territory-based names to match
its country-named methods, to better match the usage in relevant
standards. The country-based names shall in due course be deprecated
in favor of the territory-based names.
Fixes: QTBUG-91686
Change-Id: Ia1ae1ad7323867016186fb775c9600cd5113aa42
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'util/locale_database/cldr.py')
-rw-r--r-- | util/locale_database/cldr.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/util/locale_database/cldr.py b/util/locale_database/cldr.py index f2b6616fce..9b08d8a652 100644 --- a/util/locale_database/cldr.py +++ b/util/locale_database/cldr.py @@ -87,7 +87,7 @@ class CldrReader (object): give = (give[0], # Substitute according to http://www.unicode.org/reports/tr35/#Likely_Subtags have[1] if give[1] == 'AnyScript' else give[1], - have[2] if give[2] == 'AnyCountry' else give[2], + have[2] if give[2] == 'AnyTerritory' else give[2], give[3]) # AnyVariant similarly ? yield have, give @@ -676,7 +676,7 @@ enumdata.py (keeping the old name as an alias): from enumdata import language_list, script_list, country_list for form, book, empty in (('language', language_list, 'AnyLanguage'), ('script', script_list, 'AnyScript'), - ('country', country_list, 'AnyCountry')): + ('country', country_list, 'AnyTerritory')): cache[form] = dict((pair[1], (num, pair[0])) for num, pair in book.items() if pair[0] != 'C') # (Have to filter out the C locale, as we give it the |