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

QCoreApplication::installTranslator return false and do not translate app

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Fixed
    • Affects Version/s: 6.0.0 Beta3
    • Fix Version/s: 6.0.0 Beta5
    • Component/s: Core: Locales (i18n)
    • Labels:
      None
    • Environment:
      Windows 10 (FR). MSVC 2019 x64.
    • Platform/s:
      Windows
    • Commits:
      837a29b0b92c72b7b9d66a427c24a9fa8037f4f4 (qt/qtbase dev)

      Description

      Hello,

      I'm compiling a project with Qt 6.0.0 b3 and it seems ther is a bug with QCoreApplication::installTranslator.

       

      When calling it in Qt 5.13 -> OK. Same code in Qt 6.0.0 (and same code as in doc) -> KO.

       

      Here is my code sample :

       

      bool trResult= translator.load(QLocale(), QLatin1String("ademasJournalExploit"), QLatin1String("_"), QLatin1String(":/languages"));
      
      qInfo() << trResult; // true
      
      #if QT_VERSION >= 0x060000
      trResult= translatorQt.load(QLocale(), QLatin1String("qt"), QLatin1String("_"), QLibraryInfo::path(QLibraryInfo::TranslationsPath));
      qInfo() << trResult; // false (first issue)
      #else
      trResult= translatorQt.load(QLocale(), QLatin1String("qt"), QLatin1String("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); // true with Qt 5.13
      #endif
      
      qInfo() << QCoreApplication::installTranslator(&translator);  // false with Qt 6.0.0 & true with Qt 5.13
      qInfo() << QCoreApplication::installTranslator(&translatorQt); // false with Qt 6.0.0 & true with Qt 5.13

       

      Even if I only put my translation file, same results. Translation files are in my qrc file and released with QtLinguist.

      Best regards,

        Attachments

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

          Activity

            People

            Assignee:
            Eddy Edward Welbourne
            Reporter:
            brunofr93 Bruno FAUDEUX
            PM Owner:
            Maurice Kalinowski Maurice Kalinowski
            RnD Owner:
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes