Skip to content

Commit

Permalink
QLocale: document that uiLanguages() might return multiple languages
Browse files Browse the repository at this point in the history
Especially for the system locale, the list of UI languages might span
multiple languages, rather than just different variations of the same
language. That was not clear, and not covered by the test cases.

Test case augmentation in a follow up commit.

Pick-to: 6.5
Task-number: QTBUG-124898
Task-number: QTBUG-129434
Change-Id: I39dd7b35778a9ffe0bdce86b2f4c474f275f61b0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 8230c7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
  • Loading branch information
vohi authored and Qt Cherry-pick Bot committed Oct 10, 2024
1 parent fbdeec7 commit c9d31c7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/corelib/text/qlocale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4783,6 +4783,15 @@ QString QLocale::formattedDataSize(qint64 bytes, int precision, DataSizeFormats
than dashes, to separate locale tags, pass QLocale::TagSeparator::Underscore
as \a separator.
The returned list may contain entries for more than one language.
In particular, this happens for \l{QLocale::system()}{system locale}
when the user has configured the system to accept several languages
for user-interface translations. In such a case, the order of entries
for distinct languages is significant. For example, where a user has
configured a primarily German system to also accept English and Chinese,
in that order of preference, the returned list shall contain some
entries for German, then some for English, and finally some for Chinese.
Most likely you do not need to use this function directly, but just pass the
QLocale object to the QTranslator::load() function.
Expand Down

0 comments on commit c9d31c7

Please sign in to comment.