Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-131894

qtranslator loads wrong locale

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.8.1
    • Core: Locales (i18n)
    • None
    • Android

    Description

      After recompiling and deploying my app to the latest Qt, the behavior changed;
      in Qt 65x the language "en" was picked, in Qt681 the language "nl" is picked.

      Locale.uiLangages shows:
      `en-NL, en-Latn-NL, nl-NL, nl-Latn-NL, nl, en-US, en-Latn-US, en'

      the qrc contains both an 'en' and an 'nl' qm file, the 'nl' is being picked. I confirmed this by printing the translator->language() and filePath().

      auto *translator = new QTranslator(&qapp);
      if (translator->load(QLocale(), "myApp", QLatin1String("_"), QLatin1String(":/i18n"))) {
          QCoreApplication::installTranslator(translator);
      

      Picking 'nl' is wrong as the phone has explicitly specified that the language of preference is 'en' (with NL localization). The uiLanguages output is correct, and unchanged between qt653 and qt681.

      This is a user-visible regression when compared to the previous LTS version.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Eddy Edward Welbourne
              tomz Tom Zander
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes