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

Multi Languge related documents for Qt6 is not consistent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.4.2
    • Documentation
    • None
    • All
    • 18359e224 (dev), 02b75a088 (6.5)

    Description

      Summary of the issue

      Its hard for document reader to come up with the way to implement multi-language functionalities using QML6 i18n framework, the documentation may mislead the reader.

      Documents to improve

      [Internationalization and Localization with Qt Quick | Qt 6.4|https://doc.qt.io/qt-6/qtquick-internationalization.html]

      At section 9, it explains how to change language at runtime. It explains the technique by calling C/C++ methods. As the document is for QML, implementing them for general QML developer would be harder task. It might be better to explain Qt.uiLanguage which trigger language file reloading automatically when the property is changed.

      (See: QQmlApplicationEnginePrivate::init() )

       

      [QML Examples - Internationalization | Qt QML 6.4.1|https://doc.qt.io/qt-6/qtqml-qml-i18n-example.html]

      This document explains automatic loading mechanism of translation files in QML runtime. It says: "The QML runtime automatically loads a translation from the i18n subdirectory of the root QML file, based on the system language."  This "subdirectory of the root QML file" is a bit tricky phrase for CMakeLists.txt based applications. Though both QDS and QtCreator places root qml file under root directory of each project, when they come to qt resource system, they are stored under a pre-defined directory of Qt resource system. (root QML file is placed under Main directory for QDS and placed under project name directory for QtCreator), so i18n directory for storing translation files need to be placed under the directory. It may be better to add some additional description for helping 

       

      [Internationalization with Qt | Qt 6.4|https://doc.qt.io/qt-6/internationalization.html]

      This doc demonstate the way to enable translation by calling app.installTranslator() function in main.cpp. I belive its better to introduce the automate translation file loading mechanism which can be executed by placing the .qm files under <root qml's root dir>/i18n.

       

      Note

      There are miltiple inconsistency for multi-language support in Qt6. I took a note for it.

      About QML Multi-language support inconsistency - Qt Site Japan - Global Site

      Attachments

        Issue Links

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

          Activity

            People

              leenam Leena Miettinen
              takujikawata Takuji Kawata
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes