Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-121136 CMake API Review for Qt 6.7
  3. QTBUG-122671

Address Qt 6.7 CMake API review notes for qttranslations part 2

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Fixed
    • P1: Critical
    • 6.7.0
    • Build System: CMake
    • None
    • 8afecae8e (dev), 2d04db99f (dev), 05c77e4d7 (6.7), 529746b32 (6.7), ec23666bc (dev), 2bbeaf104 (6.7), dc1d3497f (dev), aa42bf24a (6.7)

    Description

      See https://git.qt.io/alcroito/qt6-cmake-api-review/-/blob/master/api_review_qt_6_7_part3.md

      qt_add_lrelease action points

      ✅ AP: Add synopsis for old qt <6.7 version as well, this means restoring the `NO_TARGET_DEPENDENCY` option and documentation

      ??? AP: Add since qt version for relevant options

      Isn't that obvious from the two synopsises we have now?

      ✅ AP: Old snippet uses the deprecated API, update to use new API

      ✅ AP: Add `LRELEASE_TARGET` option to example snippet

      ✅ AP: Check what happens if `NO_TARGET_DEPENDENCY` is used with the new API

      The option is still available and behaves like before 6.7 when using the deprecated API.
      When passing it to the new API, it's silently ignored.

      qt_add_lupdate action points

      ✅ AP: Add synopsis for old qt <6.7 version as well and documentation for old synopsis

      ??? AP: Add since qt version for relevant options

      Isn't that obvious from the two synopsises we have now?

      ✅AP: Old snippet uses the deprecated API, update to use new API

      ✅AP: Make sure to mention `LUPDATE_TARGET` in example snippet

      ✅ AP: Rename `TARGETS` to `SOURCE_TARGETS`

      qt_collect_i18n_targets action points

      ✅ AP: Rename to `qt_collect_translation_source_targets`, make sure doc snippet is updated to use `qt_add_lupdate(SOURCE_TARGETS)`

      ✅ AP: Adjust example snippet wording that the 'tests' won't be collected for translation

      ✅ AP: Link to upstream cmake doc for `BUILDSYSTEM_TARGETS`

      ✅ AP: Provide example snippet how to use with `cmake_language(DEFER CALL)`

      QT_EXCLUDE_FROM_TRANSLATION

      ✅ AP: Add doc snippets to the properties on how to set them

      QT_EXCLUDE_SOURCES_FROM_TRANSLATION

      ✅ AP: Link to both `qt_add_lupdate` and `qt_collect_i18n_targets`

      It actually does not affact qt_collect_i18n_targets. The list of excluded sources is directly passed to lupdate.
      I've linked to qt_add_lupdate.

      ✅ AP: Add doc whether one wildcard matches subdirectories as well

      There's already " The paths may be absolute or relative to
      \c

      {CMAKE_CURRENT_SOURCE_DIR}

      ." which answers the question: "bla" only matches "bla" under the current source dir.
      I've added something about the format of the wildcards.

      ✅ AP: Clarify what `are excluded from translation.` means, it refers to `SOURCE_TARGETS` option of `qt_add_lupdate`

      No, it means that the source files are ignored by lupdate.

      qt_add_translations

      ✅ AP: Add example snippet that uses `SOURCE_TARGETS`

      I "tutorialized" the whole example section.

      ✅ AP: Add synopsis for old signature as well

      ✅ AP: Consider removing doc section 'qt_add_translations before Qt 6.7' because we will document old synopsis

      Considered and rejected.
      The section contains valuable information about the difference between old and new: namely that the first argument (the target) is not necessarily used for extracting source files.

      ✅ AP: Document that variable `QT_I18N_LANGUAGES`, newly renamed to something that i don't remember, is set when
      `qt_standard_project_setup(I18N_LANGUAGES de fr)` is called in `Automatic Determination of .ts File Paths` section.

      ✅ AP: Add doc snippet with `TS_FILE_BASE` and example output.

      qt_add_lupdate

      ✅ AP: `NATIVE_TS_FILE` already renamed to plurals, double check that no more native is mentioend.

      did not find any

      ✅ AP: Make `QT_I18N_NATIVE_LANGUAGE` link to actual doc page in `Native Language` doc section.

      already done: See \l

      {Handle Plural Forms}

      for details.

      Overall translations documentation page

      https://doc-snapshots.qt.io/qt6-dev/cmake-get-started.html#adding-translations

      AP: In adding translations section on getting started with cmake, remove `TS_FILES`, because already implicit.
      Add sentence and link to bigger example on doc page of `qt_add_translations`.
      See if anything else makes sense to change.
      Overall translations documentation page

      Attachments

        Issue Links

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

          Activity

            People

              jbornema Joerg Bornemann
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: