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

QTranslator::load documentation inconsistent with source comments

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • None
    • 5.15.2
    • None
    • Windows 10 Education, QtCreator 4.13.1, QMake build, Qt 5.15.2 (but same issue in earlier versions)
    • e6e23d061cb8ac81007119603f8e7c64fc572e04

    Description

      Hi,

       

      the documentation at https://doc.qt.io/qt-5/qtranslator.html#load-1 lists ".qm" files that are loaded in the specified order.

      However, the order is different in the source code comment, see https://github.com/qt/qtbase/blob/5.15.2/src/corelib/kernel/qtranslator.cpp#L753-L763

      As far as I can see, the documentation on doc.qt.io is wrong.

      I ran into an issue where a fresh Windows 10 Education installation (German version) had the following `QLocale().uiLanguages() = ("de-DE", "en-US")`. I had following *.qm files:

      • App_de.qm
      • App_en_US.qm
      • App_en.qm
      • App_...qm

      The application was loaded in English. The following workarounds worked:

      1. Rename App_de.qm to App_de_DE.qm
      2. Remove App_en_US.qm

      IMHO, there is a mismatch between documentation and source code. I think that the source comment is correct but did no further investigation.

       

      Regards,

      Andre

      Attachments

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

        Activity

          People

            buddenha Oswald Buddenhagen
            bugwelle Andre M
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes