diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2023-07-27 15:02:56 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-08-16 16:25:48 +0200 |
commit | 91e70f239e166956c0db2d99cfb229c6b7d94598 (patch) | |
tree | 3613bca45096f6bd48b1ceaceb6906215c8c4dd4 /tests/auto/corelib/kernel | |
parent | d7bad11a87a5edcc55e6d0a45201b48f52f54e23 (diff) |
Give QLocale::uiLanguages() a separator parameter
It has always returned dash-joined forms of the locale names, and
callers who need an underscore-joined form have been obliged to
replace('-', '_') before using them. Given that everything it adds to
the list comes from QLocaleId methods that accept a separator, it's
trivial to let it offer the same choice to its callers and save them
this hassle.
Amended code in QTranslater and QMimeType to save them that hassle.
[ChangeLog][CoreLib][QLocale] QLocale::uiLanguages() now lets the
caller choose what separator to use between the tags that make up each
locale-identifier in the list returned.
Change-Id: I91fcd0b988d9a64e0e9ad9e851f6cb8c1be8ae50
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/kernel')
-rw-r--r-- | tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp index 372a7a9db1..f534389c2b 100644 --- a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp +++ b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp @@ -119,7 +119,7 @@ void tst_QTranslator::load() void tst_QTranslator::loadLocale() { QLocale locale; - auto localeName = locale.uiLanguages().value(0).replace('-', '_'); + auto localeName = locale.uiLanguages(QLocale::TagSeparator::Underscore).value(0); if (localeName.isEmpty()) QSKIP("This test requires at least one available UI language."); |