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

QQmlApplicationEngine: Be more lenient in loading translation files

    XMLWordPrintable

Details

    Description

      QQmlApplicationEngine can automatically load Qt translation files (.qm files) on startup. Anyhow, it is rather restrictive in this:

      • Translations need to be located in the resource system at :/qt/qml/<Module Name>/i18n
      • The files need to start with qml_

      The restriction on the file base name is especially limiting. As there's no convenient way to alias files in the current qt_add_translations API, it effectively forces users to also name their ts files the same. If really taken up by the user, a translator will get many .ts files named the same, for different apps.

      Possible mitigations:

      • Allow Module Name also as the name of the .qm file. So the path to check in addition would be e.g. :/qt/qml/<Module Name>/i18n/<Module Name>_de_DE.qm
      • Just load all matching qm files inside the directory of the Qt resource system:
        :/qt/qml/<Module Name>/i18n/*_de_DE.qm
      • Automatically rename .qm files as part of the qt_add_translations() call.

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes