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

[regression 6.4.2→6.4.3] translator loads wrong translation

XMLWordPrintable

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

      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
      

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes