diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 09b148ea9e..7870e31342 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -233,14 +233,6 @@ QLocaleId QLocaleId::withLikelySubtagsAdded() const if (addLikelySubtags(id)) return id; } - // language_script - if (country_id) { - QLocaleId id = QLocaleId::fromIds(language_id, script_id, 0); - if (addLikelySubtags(id)) { - id.country_id = country_id; - return id; - } - } // language_region if (script_id) { QLocaleId id = QLocaleId::fromIds(language_id, 0, country_id); @@ -249,6 +241,14 @@ QLocaleId QLocaleId::withLikelySubtagsAdded() const return id; } } + // language_script + if (country_id) { + QLocaleId id = QLocaleId::fromIds(language_id, script_id, 0); + if (addLikelySubtags(id)) { + id.country_id = country_id; + return id; + } + } // language if (script_id && country_id) { QLocaleId id = QLocaleId::fromIds(language_id, 0, 0); @@ -258,6 +258,14 @@ QLocaleId QLocaleId::withLikelySubtagsAdded() const return id; } } + // und_script + if (language_id) { + QLocaleId id = QLocaleId::fromIds(0, script_id, 0); + if (addLikelySubtags(id)) { + id.language_id = language_id; + return id; + } + } return *this; }