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

Add translations support

XMLWordPrintable

    • Icon: User Story User Story
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 6.0
    • None
    • Build System
    • None

      Apparently it's not simple to handle translations with CMake.
      The translation binary actually parses .pro files.
      So we probably have to come up with a new way how things should be done.

      EDIT:

      So afaik, the plan would be to use CMake public API for both examples and the modules themselves.

      Work is being done to teach lupdate to use a compilation database for figuring out which files need to be processed (from which files to extract strings).
      Until that is done it is possible to give lupdate a path, that will glob through all files under that path and extract strings.

      The workflow would then be to run lupdate to create .ts file with strings, and then run lrelease to create the binary blobs. Afaik the macros already exist in Qt5 and should be ported to Qt6 and used, docs here https://doc-snapshots.qt.io/qt5-dev/cmake-command-reference.html#qt5-linguisttools .

      I guess what would be useful to implement, is targets like translations_Core, which would run lupdate and lrelease on the specified target.

      qmake does its magic in qttranslations/translations/translations.pro
      and once qmake is executed there, you have targets like make, make ts-de, make ts-qtdeclarative-de

      Not sure if we want to keep the Makefile targets per repo or per cmake target.

      Some partially outdated info at https://wiki.qt.io/Qt_Localization
      https://wiki.qt.io/Automating_generation_of_qm_files

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

            lebeernae Leander Beernaert
            alexandru.croitor Alexandru Croitor
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes