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

Clarify the case where QML and C++ both contain translatable strings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.0
    • None

    Description

      In this link: https://doc.qt.io/qt-6/localization.html

      There's a sentence which states:

       

      You can even have user interface strings in QML and C++ source files in the same application. The system will create a single combined translation file and the strings are accessible from QML and C++ code. 

      But in this link: https://doc.qt.io/qt-6/i18n-source-translation.html#qml-use-qqmlapplicationengine

       

      There are sentences like this:

      QML: Use QQmlApplicationEngine
      The translation file names must have the prefix qml_. For example, qml_en_US.qm. 
      C++: Use QTranslator
      In C++, the TS file names must contain the application name. For example, app_de_DE.ts.
      

      Now the unclear part is
      When Qt Quick app requires "qml_" prefix and for C++ translatable texts require the name of the app to be part of the name of .ts files, would this be "qml_<appname>_de_DE.ts"?

      Would this be possible to clarify this point in these links?

      https://doc.qt.io/qt-6/localization.html
      https://doc.qt.io/qt-6/i18n-source-translation.html#qml-use-qqmlapplicationengine

      Attachments

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

        Activity

          People

            kkohne Kai Köhne
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes