diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2023-08-01 12:35:26 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-08-09 17:53:42 +0200 |
commit | 1ae24f8b50876659dca80c6e42c02e7d0481e961 (patch) | |
tree | 6dc23f46b5f783a50c31a8178abd04c3df9ca46b /util/locale_database/cldr.py | |
parent | afd7d68244038926bd9bf49411a66fd77107bcb1 (diff) |
Use CLDR's names in QLocale::*ToName() for language, script, territory
Various comments need to continue using the enumdata.py names, as they
associate data with particular enum members, but we can now correctly
use the en.xml versions of their names when we report them, rather
than the enum-friendly names we use in the code. Since this now means
the data may stray outside plain ASCII - it'll be UTF-8-encoded - this
implies replacing the QLatin1StringView()s of the code that formerly
read this data with QString::fromUtf8().
Fixes: QTBUG-94460
Change-Id: Id3b08875a46af58c0555c3e303b0e15a19441509
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'util/locale_database/cldr.py')
-rw-r--r-- | util/locale_database/cldr.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/locale_database/cldr.py b/util/locale_database/cldr.py index d1ad90295e..a725526dbf 100644 --- a/util/locale_database/cldr.py +++ b/util/locale_database/cldr.py @@ -254,6 +254,9 @@ class CldrAccess (object): inheritance, where relevant.""" return LocaleScanner(name, self.__localeRoots(name), self.__rootLocale) + def englishNaming(self, tag): # see QLocaleXmlWriter.enumData() + return self.__codeMap(tag).get + @property def fileLocales(self) -> Iterable[str]: """Generator for locale IDs seen in file-names. |