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

Documentation about dynamic translations with QML could be improved

    XMLWordPrintable

Details

    • All
    • 69fce1185 (dev), e0eb137af (6.6), 204b47558 (tqtc/lts-6.5)

    Description

      Hi,

      I have found that now you can do easily dynamic translation, relying on the QQmlApplicationEngine (https://doc.qt.io/qt-6/qqmlapplicationengine.html#details). However when I tried to create an empty project with the template from Qt Creator 11 for Qt 6.5, I could not have my string translated (event using qm_fr.ts notations, adding manually the files in qt_add_translations())

      Then I found out too that since 6.5 there is an example qml/qml-i18n to support the documentation but it does not use the approach you have when you create an empty project:

      • why using engine.load() and not engine.loadFromModule()
      • why using NO_RESOURCE_TARGET_PATH in the qt_add_qml_module()

      I think this is really nice how simply you can use dynamic translations with Qt 6.5 now but I would like to be aware of the limitations, what is really needed and so on...

      I think the following parts could be a bit detailed and maybe referencing between each other too:
      https://doc.qt.io/qt-6/qml-qtqml-qt.html#uiLanguage-prop
      https://doc.qt.io/qt-6/i18n-source-translation.html#qml-use-qqmlapplicationengine

      https://doc.qt.io/qt-6/qqmlapplicationengine.html#details

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-116588
          # Subject Branch Project Status CR V

          Activity

            People

              qtqmlteam Qt Qml Team User
              pijaouen Pierre Jaouen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes