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

[regression 6.4.2→6.4.3] translator loads wrong translation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 6.4.3
    • Core: Locales (i18n)
    • None
    • Android

    Description

      Consider the following snippet;

      QGuiApplication qapp(argc, argv);
      [...]
      static const char* languagePacks[] = {
          "tom-mobile",
          "tom-common",
          nullptr
      };
      
      for (int i = 0; languagePacks[i]; ++i) {
          auto *translator = new QTranslator(&qapp);
          if (translator->load(QLocale(), languagePacks[i], QLatin1String("_"), QLatin1String(":/i18n")))
              QCoreApplication::installTranslator(translator);
          else
              delete translator;
      }
      

      This got deployed with qrc:

      • tom-mobile_nl.qm
      • tom-common_nl.qm
      • tom-common_en.qm

      When I run it on the phone the locale.name() prints "en_NL".

      The behavior of the above snippet is that on at least one phone I see Dutch (nl) translations appear for the 'mobile' unit.

      What I expect is that the common_en translations are loaded and nothing is loaded for the mobile segments.

      The expected behavior is what is happening on the released 6.4.2. The weird behavior is observed on the 6.4.3 branch. Specifically:

      Fail sha1 (qtcore): aecaf09913771e823575b8b382070a3eaa8aeae6
      

      Attachments

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

        Activity

          People

            kkohne Kai Köhne
            tomz Tom Zander
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes