Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Qt6 CMake API Review
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexandru Croitor
Qt6 CMake API Review
Commits
739c0c4f
Commit
739c0c4f
authored
1 year ago
by
Alexandru Croitor
Browse files
Options
Downloads
Patches
Plain Diff
Split 6.7 translation api review into 3 parts
parent
fbd0d166
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api_review_qt_6_7_part2.md
+1
-262
1 addition, 262 deletions
api_review_qt_6_7_part2.md
api_review_qt_6_7_part3.md
+322
-0
322 additions, 0 deletions
api_review_qt_6_7_part3.md
with
323 additions
and
262 deletions
api_review_qt_6_7_part2.md
+
1
−
262
View file @
739c0c4f
# Task and links
https://bugreports.qt.io/browse/QTBUG-121136
https://git.qt.io/alcroito/qt6-cmake-api-review/-/blob/master/api_review_qt_6_7.md
https://git.qt.io/alcroito/qt6-cmake-api-review/-/blob/master/api_review_qt_6_7
_part2
.md
# Changes
...
...
@@ -84,152 +84,6 @@ AP: Update example snippet with something richer
AP: Update
`NATIVE_TS_FILE`
to
`PLURALS_TS_FILE`
### `qt_add_lrelease` - New API options and changed option
Make the target argument of
`qt_add_lrelease`
optional.
Passing a target as the first argument to
`qt_add_lrelease`
was deprecated.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-lrelease.html
https://codereview.qt-project.org/c/qt/qttools/+/496435
Old signature
```
cmake
qt_add_lrelease
(
target TS_FILES file1.ts [file2.ts ...]
[NO_TARGET_DEPENDENCY]
```
New signature
```
cmake
qt_add_lrelease
(
TS_FILES file1.ts [file2.ts ...]
[LRELEASE_TARGET target-name]
[EXCLUDE_FROM_ALL]
```
Documented.
No specific example snippet.
No "since qt version" blurb for new / changed options.
`NO_TARGET_DEPENDENCY`
disappeared from docs, not mentioned in deprecated section.
First
`target`
option that is now deprecated IS documented.
**Notes:**
**Action points:**
### `qt_add_lupdate` - New API options and changed option
Allow specifying multiple targets in
`qt_add_lupdate`
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-lupdate.html
https://codereview.qt-project.org/c/qt/qttools/+/495546
Old signature
```
cmake
qt_add_lupdate
(
target TS_FILES file1.ts [file2.ts ...]
```
New signature
```
cmake
qt_add_lupdate
(
TS_FILES file1.ts [file2.ts ...]
[TARGETS target1 [target2 ...]]
```
Documented.
No specific example snippet.
No "since qt version" blurb for new / changed options.
First
`target`
option that is now deprecated IS documented.
**Notes:**
**Action points:**
### `qt_collect_i18n_targets` - New API
Add
`qt_collect_i18n_targets`
, collects targets that are eligible for translation.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-collect-targets-for-translation.html
https://codereview.qt-project.org/c/qt/qttools/+/496434
Signature
```
cmake
qt_collect_i18n_targets
(
out_var [DIRECTORY path]
)
```
Documented.
Has "since qt version" blurb.
Has example snippet.
**Notes:**
**Action points:**
### `QT_EXCLUDE_FROM_TRANSLATION` - New target and directory properties
Targets can be excluded from translation by setting the target property
`QT_EXCLUDE_FROM_TRANSLATION`
to TRUE
Targets below a certain directory can be excluded from translation by
setting the directory property
`QT_EXCLUDE_FROM_TRANSLATION`
to TRUE.
https://doc-snapshots.qt.io/qt6-dev/cmake-directory-property-qt-exclude-from-translation.html
https://doc-snapshots.qt.io/qt6-dev/cmake-target-property-qt-exclude-from-translation.html
https://codereview.qt-project.org/c/qt/qttools/+/496434
Documented.
Has "since qt version" blurb.
No example snippets.
**Notes:**
**Action points:**
### `QT_EXCLUDE_SOURCES_FROM_TRANSLATION` - New target property
Allow excluding target sources from i18n.
The target property
`QT_EXCLUDE_SOURCES_FROM_TRANSLATION`
was added to exclude source files of
a target from handling with lupdate.
https://doc-snapshots.qt.io/qt6-dev/cmake-target-property-qt-exclude-sources-from-translation.html
https://codereview.qt-project.org/c/qt/qttools/+/498913
Signature
```
cmake
set_property
(
TARGET myapp PROPERTY QT_EXCLUDE_SOURCES_FROM_TRANSLATION
untranslatable.cpp
3rdparty/*
)
```
Documented.
Has "since qt version" blurb.
Has example snippet.
**Notes:**
**Action points:**
### `qt_add_translations` - New API options and behavior change
...
...
@@ -280,118 +134,3 @@ https://doc.qt.io/qt-6/linguist-id-based-i18n.html
AP: Mention idbased option on qt_add_translations doc page, and link to page above
just mention
`LRELEASE_OPTIONS -idbased`
AP: Kai: Talk to qt design team why they use idbased translations
### `qt_add_translations` - New API options and behavior change
Automatically determine
`.ts`
file names in
`qt_add_translations`
The
`TS_FILES`
argument of
`qt_add_translations`
is
optional now, and .ts file paths can be automatically determined after
setting the
`QT_I18N_LANGUAGES`
variable.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-translations.html
https://codereview.qt-project.org/c/qt/qttools/+/501634
Old signature
```
cmake
qt_add_translations
(
[target]
TS_FILES file1.ts [file2.ts ...]
```
New signature
```
cmake
qt_add_translations
(
[target]
[TS_FILE_BASE name]
[TS_FILE_DIR directory]
[TS_FILES file1.ts [file2.ts ...]]
```
Documented.
Has example snippet.
No "since qt version" blurb for new options.
**Notes:**
**Action points:**
### `qt_add_translations` - Behavior change
Automatically determine the path of the native .ts file
If the
`TS_FILES`
argument is not passed to
`qt_add_translations`
, the path to the native .ts file is automatically
determined if
`QT_I18N_NATIVE_LANGUAGE`
variable is set.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-translations.html
https://codereview.qt-project.org/c/qt/qttools/+/503733
Documented.
No example / comparison snippet.
No "since qt version" blurb for new options.
**Notes:**
**Action points:**
### `qt_add_lupdate` - New API options and behavior change
Add a way to specify the native language for i18n
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-translations.html
https://codereview.qt-project.org/c/qt/qttools/+/502121
Old signature
```
cmake
qt_add_lupdate
(
TS_FILES file1.ts [file2.ts ...]
```
New signature
```
cmake
qt_add_lupdate
(
TS_FILES file1.ts [file2.ts ...]
[NATIVE_TS_FILE file.ts]
```
Documented.
No example snippet.
No "since qt version" blurb for new options.
**Notes:**
**Action points:**
### Overall translations documentation page
We are missing a more general adding translations page after all the new API was added.
The most prominent CMake one is
https://doc-snapshots.qt.io/qt6-dev/cmake-get-started.html#adding-translations
which is quite short.
And the generic ones at
https://doc-snapshots.qt.io/qt6-dev/internationalization.html
https://doc-snapshots.qt.io/qt6-dev/localization.html
don't mention very much about build systems.
**Notes:**
**Action points:**
This diff is collapsed.
Click to expand it.
api_review_qt_6_7_part3.md
0 → 100644
+
322
−
0
View file @
739c0c4f
# Task and links
https://bugreports.qt.io/browse/QTBUG-121136
https://git.qt.io/alcroito/qt6-cmake-api-review/-/blob/master/api_review_qt_6_7_part3.md
# Changes
## qttools
### `qt_add_lrelease` - New API options and changed option
Make the target argument of
`qt_add_lrelease`
optional.
Passing a target as the first argument to
`qt_add_lrelease`
was deprecated.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-lrelease.html
https://codereview.qt-project.org/c/qt/qttools/+/496435
Old signature
```
cmake
qt_add_lrelease
(
target TS_FILES file1.ts [file2.ts ...]
[NO_TARGET_DEPENDENCY]
```
New signature
```
cmake
qt_add_lrelease
(
TS_FILES file1.ts [file2.ts ...]
[LRELEASE_TARGET target-name]
[EXCLUDE_FROM_ALL]
```
Documented.
No specific example snippet.
No "since qt version" blurb for new / changed options.
`NO_TARGET_DEPENDENCY`
disappeared from docs, not mentioned in deprecated section.
First
`target`
option that is now deprecated IS documented.
**Notes:**
**Action points:**
### `qt_add_lupdate` - New API options and changed option
Allow specifying multiple targets in
`qt_add_lupdate`
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-lupdate.html
https://codereview.qt-project.org/c/qt/qttools/+/495546
Old signature
```
cmake
qt_add_lupdate
(
target TS_FILES file1.ts [file2.ts ...]
```
New signature
```
cmake
qt_add_lupdate
(
TS_FILES file1.ts [file2.ts ...]
[TARGETS target1 [target2 ...]]
```
Documented.
No specific example snippet.
No "since qt version" blurb for new / changed options.
First
`target`
option that is now deprecated IS documented.
**Notes:**
**Action points:**
### `qt_collect_i18n_targets` - New API
Add
`qt_collect_i18n_targets`
, collects targets that are eligible for translation.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-collect-targets-for-translation.html
https://codereview.qt-project.org/c/qt/qttools/+/496434
Signature
```
cmake
qt_collect_i18n_targets
(
out_var [DIRECTORY path]
)
```
Documented.
Has "since qt version" blurb.
Has example snippet.
**Notes:**
**Action points:**
### `QT_EXCLUDE_FROM_TRANSLATION` - New target and directory properties
Targets can be excluded from translation by setting the target property
`QT_EXCLUDE_FROM_TRANSLATION`
to TRUE
Targets below a certain directory can be excluded from translation by
setting the directory property
`QT_EXCLUDE_FROM_TRANSLATION`
to TRUE.
https://doc-snapshots.qt.io/qt6-dev/cmake-directory-property-qt-exclude-from-translation.html
https://doc-snapshots.qt.io/qt6-dev/cmake-target-property-qt-exclude-from-translation.html
https://codereview.qt-project.org/c/qt/qttools/+/496434
Documented.
Has "since qt version" blurb.
No example snippets.
**Notes:**
**Action points:**
### `QT_EXCLUDE_SOURCES_FROM_TRANSLATION` - New target property
Allow excluding target sources from i18n.
The target property
`QT_EXCLUDE_SOURCES_FROM_TRANSLATION`
was added to exclude source files of
a target from handling with lupdate.
https://doc-snapshots.qt.io/qt6-dev/cmake-target-property-qt-exclude-sources-from-translation.html
https://codereview.qt-project.org/c/qt/qttools/+/498913
Signature
```
cmake
set_property
(
TARGET myapp PROPERTY QT_EXCLUDE_SOURCES_FROM_TRANSLATION
untranslatable.cpp
3rdparty/*
)
```
Documented.
Has "since qt version" blurb.
Has example snippet.
**Notes:**
**Action points:**
### `qt_add_translations` - New API options and behavior change
Support project-wide i18n with
`qt_add_translations`
.
Gained the
`TARGETS`
argument to specify multiple targets that intend to load .qm files.
Gained the
`SOURCE_TARGETS`
argument to specify multiple targets that contain sources with
translatable strings.
If the first argument of
`qt_add_translations`
is a target, that target is not used
anymore for extracting translatable sources.
Now defers itself to the end of the scope of
`PROJECT_SOURCE_DIR`
if
`SOURCE_TARGETS`
is not given.
This behavior can be turned off by passing
`IMMEDIATE_CALL`
.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-translations.html
https://codereview.qt-project.org/c/qt/qttools/+/498033
Old signature
```
cmake
qt_add_translations
(
target TS_FILES file1.ts [file2.ts ...]
```
New signature
```
cmake
qt_add_translations
(
[target]
[TARGETS target1 [target2...]]
[SOURCE_TARGETS target1 [target2...]]
TS_FILES file1.ts [file2.ts ...]
[IMMEDIATE_CALL]
)
```
Documented.
No
`IMMEDIATE_CALL`
example snippet.
Partial "since qt version" blurb for new / changed options.
**Notes:**
**Action points:**
AP: There is a use case to pass in extra qm files (e.g qt sdk translations) to
`qt_add_translations`
to merge them, currently not released, open gerrit change,
possibly in Qt 6.8.
AP: Look into what happens when id-based translations are mixed with regular translations
https://doc.qt.io/qt-6/linguist-id-based-i18n.html
AP: Mention idbased option on qt_add_translations doc page, and link to page above
just mention
`LRELEASE_OPTIONS -idbased`
AP: Kai: Talk to qt design team why they use idbased translations
### `qt_add_translations` - New API options and behavior change
Automatically determine
`.ts`
file names in
`qt_add_translations`
The
`TS_FILES`
argument of
`qt_add_translations`
is
optional now, and .ts file paths can be automatically determined after
setting the
`QT_I18N_LANGUAGES`
variable.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-translations.html
https://codereview.qt-project.org/c/qt/qttools/+/501634
Old signature
```
cmake
qt_add_translations
(
[target]
TS_FILES file1.ts [file2.ts ...]
```
New signature
```
cmake
qt_add_translations
(
[target]
[TS_FILE_BASE name]
[TS_FILE_DIR directory]
[TS_FILES file1.ts [file2.ts ...]]
```
Documented.
Has example snippet.
No "since qt version" blurb for new options.
**Notes:**
**Action points:**
### `qt_add_translations` - Behavior change
Automatically determine the path of the native .ts file
If the
`TS_FILES`
argument is not passed to
`qt_add_translations`
, the path to the native .ts file is automatically
determined if
`QT_I18N_NATIVE_LANGUAGE`
variable is set.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-translations.html
https://codereview.qt-project.org/c/qt/qttools/+/503733
Documented.
No example / comparison snippet.
No "since qt version" blurb for new options.
**Notes:**
**Action points:**
### `qt_add_lupdate` - New API options and behavior change
Add a way to specify the native language for i18n
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-translations.html
https://codereview.qt-project.org/c/qt/qttools/+/502121
Old signature
```
cmake
qt_add_lupdate
(
TS_FILES file1.ts [file2.ts ...]
```
New signature
```
cmake
qt_add_lupdate
(
TS_FILES file1.ts [file2.ts ...]
[NATIVE_TS_FILE file.ts]
```
Documented.
No example snippet.
No "since qt version" blurb for new options.
**Notes:**
**Action points:**
### Overall translations documentation page
We are missing a more general adding translations page after all the new API was added.
The most prominent CMake one is
https://doc-snapshots.qt.io/qt6-dev/cmake-get-started.html#adding-translations
which is quite short.
And the generic ones at
https://doc-snapshots.qt.io/qt6-dev/internationalization.html
https://doc-snapshots.qt.io/qt6-dev/localization.html
don't mention very much about build systems.
**Notes:**
**Action points:**
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment