diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2022-04-22 16:09:30 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2022-04-27 17:03:54 +0200 |
commit | 0b5b98c4aecb023a880fe49444b3d8f01810b4f6 (patch) | |
tree | ee0b07281d890c44269a156e71ac54a3bb08bed2 /tests/auto/corelib | |
parent | 7a7f2547f3e9ddf4e50decd85189200033193177 (diff) |
Fix qlocale_unix's handling of uiLanguages to take script into account
Some languages have, in the same territory, locales for more than one
script. In such cases, since we ignored the script, we got the one
that is used by default, instead of the one actually asked for. Take
the script into account.
Added TODO comment in test listing the known examples of this;
manually tested before and after the fix to verify the prior code was
indeed getting it wrong and now does do it right.
Change-Id: Iaf9201d6992bc39e6e9346ef8b7c69d418db7253
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/text/qlocale/tst_qlocale.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 7095728dce..9c69e9fe4a 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -2962,6 +2962,12 @@ void tst_QLocale::uiLanguages_data() QTest::newRow("zh_Hans_CN") << QLocale(QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China) << QStringList{QString("zh-Hans-CN"), QString("zh-CN"), QString("zh")}; + + // TODO: test actual system backends correctly handle locales with + // script-specificity (script listed first is the default, in CLDR v40): + // az_{Latn,Cyrl}_AZ, bs_{Latn,Cyrl}_BA, sr_{Cyrl,Latn}_{BA,RS,XK,UZ}, + // sr_{Latn,Cyrl}_ME, ff_{Latn,Adlm}_{BF,CM,GH,GM,GN,GW,LR,MR,NE,NG,SL,SN}, + // shi_{Tfng,Latn}_MA, vai_{Vaii,Latn}_LR, zh_{Hant,Hans}_{MO,HK} } void tst_QLocale::uiLanguages() |