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

lupdate support for specifying QML/QtScript translation contexts

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Not Evaluated
    • None
    • None
    • Tools: Linguist
    • None

    Description

      In addition to QTBUG-11859, tooling support is needed in order to specify which translation context should be stored in the .ts file when qsTr() translations are extracted from scripts and QML files. Without this, the developer has to fix-up the .ts file each time it's updated from sources, which is error-prone and a nuisance.

      A simple (and sufficient?) solution would be to add a -contextprefix option to lupdate, so that the context can be manually specified when invoking lupdate on a particular qml file (folder/module?). Additional tooling (e.g. .pro file support) could be built on top of that.

      Alternatively, the qmldir format could perhaps be extended as follows:

      • Add a way to specify something akin to the qmake TRANSLATIONS variable
      • Add a way to specify a translation prefix. This should match the path
        in which the qmldir file resides, relative to the module root. (It'd be
        a similar type of rendundancy to "package foo.bar" in Java...)

      And lupdate could be taught to process qmldir files and derive the translation context from there.

      Attachments

        Issue Links

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

          Activity

            People

              kenthans Kent Hansen (Inactive)
              kenthans Kent Hansen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes