Commit Graph

18 Commits

Author SHA1 Message Date
Eike Ziller
694dec5b0f Build/translations: Fix if build dir contains regex characters
We need to escape all regex relevant characters before using the build
directory as part of a regex.

Amends fc236d4534

Change-Id: Idfb9e5a1733e153943781888976de97aac4fb8cb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2023-06-20 06:54:10 +00:00
Eike Ziller
fc236d4534 Build: Avoid building Qt Creator when running translation targets
The "project sources" contain lots of generated files that we are not
interested in, simply exclude anything from the build directory.
The *_tr.h header that we generate for the wizards and external tools
are handled separately.

Change-Id: I2ab1d6ac4312b1140ee475f8f16ba82d8488c43e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-06-16 13:20:17 +00:00
Eike Ziller
2bc37de42b Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/python/pipsupport.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/qtsupport/examplesparser.cpp
	tests/auto/examples/tst_examples.cpp

Change-Id: I00273622423fa99d41621969f6ecbbdaa0e18664
2023-04-13 15:59:08 +02:00
Eike Ziller
a6512861ea Build: Fix result of ts_ targets
Created .ts files with the wrong name.

Amends 556e7315f7

Change-Id: I3c0199c564f47dce178a9d8218d5dacf8c75f78a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-04-11 13:59:36 +00:00
Eike Ziller
1029cb959b Build: Fix translation targets
Filter out .pro files from the translation sources.
A ProjectExplorer test was added that added files like
`multi-target-project-app.pro` to the target sources.
lupdate then triggers a call for lupdate-pro, which in turn fails.

Also filter .css files, which result in lupdate warnings.

Change-Id: Ib2fa5f0228307bc5850915ed89c14a0956d1d6a8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-21 14:09:49 +00:00
Eike Ziller
c7e94d80c7 Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/shared/qbs

Change-Id: I33e13270c8c15a51b4ce4eaa6b4584041ed124e0
2023-03-13 12:30:04 +01:00
Eike Ziller
556e7315f7 Build: Simplify ts_all* targets and add "ts_all_cleaned"
Instead of trying to update all files in a single lupdate call,
make the ts_all targets just depend on the individual language targets.
It is less efficient, but not used often, simpler to setup and since
lconvert cannot work on mutliple .ts files simultanously easier to
setup a ts_all_cleaned target.

Change-Id: I60718408a661f011d84f3f74645e2f8fd49a95d1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-03-09 07:40:03 +00:00
Eike Ziller
66d4e12a58 Build: Remove FindQt5.cmake
No longer needed, since we generally only support building with
Qt 6 nowadays, and the parts that still do support building with
Qt 5 handle that manually.

Change-Id: I72381589ca3ab7bf1af88d9f185cad7f0cdf149c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-23 07:12:44 +00:00
Eike Ziller
133b78dafa Build: Sort contexts on translation updates
Change-Id: I484f42ff9e3d41f8830d5f531de9e4d8cdfa9c88
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-02-20 13:20:54 +00:00
Eike Ziller
1938926c69 Build: Add target for lupdate with obsolete, without locations
Which would be something that we can check into the repository.

Change-Id: I14e3a6d5e5a505b4ae0dc4b22046834ee645ef9c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-02-17 11:02:46 +00:00
Eike Ziller
55fa109b59 CMake build: Use version-less Qt targets
Since we do not support Qt < 5.15 anymore, and as a first step
for getting rid of our special FindQt5.cmake.

Change-Id: Icc5dbaf9b0a3a622b1f609ff114b9decb6d2856c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-01-05 10:13:16 +00:00
Eike Ziller
872994b5e5 CMake/translations: Use lconvert for cleaning ts files
For the translation process it is nice to keep obsolete items and locations,
but we do not want these submitted in the end. So while translating we'd have
patches:

1. lupdate cleaned of obsolete and line numbers
2. wip: lupdate with obsolete and line numbers
3. translation of plugin X
4. translation of plugin Y

and before submitting we want to remove the wip patch (2).

But, running lupdate with "-no-obsolete -locations none" for cleaning
the ts file has a slightly different sorting than without it, which
leads to conflicts when removing the wip patch (2).

Instead run lupdate with obsolete items and line numbers first, and
clean the ts file with lconvert afterwards. That keeps the diff between
patch (1) and (2) minimal, and results in a clean rebase process when
removing patch (2).

Change-Id: I3b8ac7c30dc6eb0e501be765eb6e64069007a5bd
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-09 11:11:13 +00:00
Eike Ziller
da364bd4df Translations: Add targets that update translations without the cruft
Without obsolete and vanished translations, and files and line numbers.
Which is what we would in the end submit into the repository.

run with `cmake --build . --target ts_<lang>_cleaned`

Change-Id: If5b73f19d8fc7b49bcf95fbeb0b0ff7793056cca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-10-31 08:46:43 +00:00
Eike Ziller
1cb4f33dfb CMake build: Fix include paths passed to lupdate
The include paths that we extract from the targets often still contain
the generator expression, like $<BUILD_INTERFACE:actual/include/path>.
Throw away "paths" with generator expressions that we don't care about,
and strip the BUILD_INTERFACE expression around the paths, which are the
ones that we do care about.

This wasn't only partially relevant so far, though it probably was the
reason for the need for fully qualified tr(...) calls at some places.
It becomes essential when we move to the <Plugin>::Tr class, which
requires an include to <plugin>tr.h, which is otherwise not found for
files that are not in the same directory.

Change-Id: I7a0183f002973069839920ec29944342cfd91721
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-07-08 13:04:06 +00:00
Eike Ziller
ae2e57b167 Ignore .json.in and .svg files for translations
Amends 30bb32d9af
which added the .json.in files to the list of target sources.

Change-Id: I7282cfcda50cbd156403a23cce06baed9698bb4d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-27 07:05:29 +00:00
Eike Ziller
40e87880fd CMake: Make it possible to run ts_* targets with Qt 6
Alias for lupdate for missing

Change-Id: I8a9a68e6d3be54ab8e1d143d3611e9d8da6d760d
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-07-14 10:15:54 +00:00
Knud Dollereder
9a4e65cc73 CMake Build: Ensure valid destinations for generated files
- Make the build system aware that empty_pch.c/.cpp are generated files
  to prevent invalid access from _add_pch_target.
- Force the creation of the translation output directory before copying
qm files into it.

Change-Id: Iaff5e5ebdbfec7e89a47d277d95f9dec760a5b6b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-01 09:35:58 +00:00
Eike Ziller
cc04c8d8e4 CMake build: Make translation function available to external plugins
And fix that the "ts_all" target did not get the custom target prefix.

Change-Id: Iff6a5e328456f3d949c31f2e41b48c400fad773c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-05-05 09:48:31 +00:00