summaryrefslogtreecommitdiffstats
path: root/src/sdk/translations/translations.pro
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-02-08 19:41:40 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-02-28 10:17:59 +0000
commit5ec853169633d958c653c2a9431225e37843af98 (patch)
treef43a528df3e8bf8a565607501a182f60aff5f709 /src/sdk/translations/translations.pro
parent4f1e3f8e047457d3aa7b730c4afd01dcbac61314 (diff)
move ts targets to a separate project file
that makes it possible to update the templates even if the ifw itself cannot be built (e.g., due to using a -no-widgets qt build). Change-Id: Ie170e6524dbed40f6c8b837e35af6b45a1c2d2dd Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/sdk/translations/translations.pro')
-rw-r--r--src/sdk/translations/translations.pro40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/sdk/translations/translations.pro b/src/sdk/translations/translations.pro
new file mode 100644
index 000000000..8a77a0b44
--- /dev/null
+++ b/src/sdk/translations/translations.pro
@@ -0,0 +1,40 @@
+TEMPLATE = aux
+
+include(../../../installerfw.pri)
+
+!exists($$LUPDATE): return()
+
+IB_TRANSLATIONS = $$files($$PWD/*_??.ts)
+IB_TRANSLATIONS -= $$PWD/ifw_en.ts
+
+wd = $$toNativeSeparators($$IFW_SOURCE_TREE)
+sources = src
+lupdate_opts = -locations relative -no-ui-lines -no-sort
+
+IB_ALL_TRANSLATIONS = $$IB_TRANSLATIONS $$PWD/ifw_untranslated.ts
+for(file, IB_ALL_TRANSLATIONS) {
+ lang = $$replace(file, .*_([^/]*)\\.ts, \\1)
+ v = ts-$${lang}.commands
+ $$v = cd $$wd && $$LUPDATE $$lupdate_opts $$sources -ts $$file
+ QMAKE_EXTRA_TARGETS += ts-$$lang
+}
+ts-all.commands = cd $$wd && $$LUPDATE $$lupdate_opts $$sources -ts $$IB_ALL_TRANSLATIONS
+QMAKE_EXTRA_TARGETS += ts-all
+
+isEqual(QMAKE_DIR_SEP, /) {
+ commit-ts.commands = \
+ cd $$wd; \
+ git add -N src/sdk/translations/*_??.ts && \
+ for f in `git diff-files --name-only src/sdk/translations/*_??.ts`; do \
+ $$LCONVERT -locations none -i \$\$f -o \$\$f; \
+ done; \
+ git add src/sdk/translations/*_??.ts && git commit
+} else {
+ commit-ts.commands = \
+ cd $$wd && \
+ git add -N src/sdk/translations/*_??.ts && \
+ for /f usebackq %%f in (`git diff-files --name-only src/sdk/translations/*_??.ts`) do \
+ $$LCONVERT -locations none -i %%f -o %%f $$escape_expand(\\n\\t) \
+ cd $$wd && git add src/sdk/translations/*_??.ts && git commit
+}
+QMAKE_EXTRA_TARGETS += commit-ts