summaryrefslogtreecommitdiff
path: root/translations
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-03-22 17:34:04 +0100
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-03-31 11:06:15 +0200
commit3a0f70a89c46220a6404968e1611d8e35b64b922 (patch)
treef2bc08c4e56d5d20b0b614b2ac86b0ec54207dea /translations
parent0f15ab4e750690bdb2b649332d5c3276bf24c440 (diff)
downloadqt4-tools-3a0f70a89c46220a6404968e1611d8e35b64b922.tar.gz
absorb translations.pri into translations.pro
this moves the various ts targets into the translations/ directory. creator and mobility already employ this scheme.
Diffstat (limited to 'translations')
-rw-r--r--translations/translations.pri80
-rw-r--r--translations/translations.pro82
2 files changed, 81 insertions, 81 deletions
diff --git a/translations/translations.pri b/translations/translations.pri
deleted file mode 100644
index 1576bd53d3..0000000000
--- a/translations/translations.pri
+++ /dev/null
@@ -1,80 +0,0 @@
-qtPrepareTool(LCONVERT, lconvert)
-qtPrepareTool(LUPDATE, lupdate)
-LUPDATE += -locations relative -no-ui-lines
-
-TS_TARGETS =
-
-# meta target name, target name, lupdate base options, files
-defineTest(addTsTarget) {
- cv = $${2}.commands
- $$cv = cd $$QT_SOURCE_TREE/src && $$LUPDATE $$3 -ts $$4
- export($$cv)
- dv = $${1}.depends
- $$dv += $$2
- export($$dv)
- TS_TARGETS += $$1 $$2
- export(TS_TARGETS)
-}
-
-# target basename, lupdate base options
-defineTest(addTsTargets) {
- files = $$files($$PWD/$${1}_??.ts) $$files($$PWD/$${1}_??_??.ts)
- for(file, files) {
- lang = $$replace(file, .*_((.._)?..)\\.ts$, \\1)
- addTsTarget(ts-$$lang, ts-$$1-$$lang, $$2, $$file)
- }
- addTsTarget(ts-untranslated, ts-$$1-untranslated, $$2, $$PWD/$${1}_untranslated.ts)
- addTsTarget(ts-all, ts-$$1-all, $$2, $$PWD/$${1}_untranslated.ts $$files)
-}
-
-addTsTargets(qt, -I../include -I../include/Qt \
- 3rdparty/phonon \
- 3rdparty/webkit \
- activeqt \
- corelib \
- declarative \
- gui \
- multimedia \
- network \
- opengl \
- plugins \
- qt3support \
- script \
- scripttools \
- sql \
- svg \
- xml \
- xmlpatterns \
-)
-addTsTargets(designer, ../tools/designer/designer.pro)
-addTsTargets(linguist, ../tools/linguist/linguist.pro)
-addTsTargets(assistant, ../tools/assistant/tools/tools.pro)
-addTsTargets(qt_help, ../tools/assistant/lib/lib.pro)
-addTsTargets(qtconfig, ../tools/qtconfig/qtconfig.pro)
-addTsTargets(qvfb, ../tools/qvfb/qvfb.pro)
-
-check-ts.commands = (cd $$PWD && perl check-ts.pl)
-check-ts.depends = ts-all
-
-isEqual(QMAKE_DIR_SEP, /) {
- commit-ts.commands = \
- cd $$PWD/..; \
- for f in `git diff-files --name-only translations/*_??.ts`; do \
- $$LCONVERT -locations none -i \$\$f -o \$\$f; \
- done; \
- git add translations/*_??.ts && git commit
-} else {
- wd = $$replace(PWD, /, \\)\\..
- commit-ts.commands = \
- cd $$wd && \
- for /f usebackq %%f in (`git diff-files --name-only translations/*_??.ts`) do \
- $$LCONVERT -locations none -i %%f -o %%f $$escape_expand(\\n\\t) \
- cd $$wd && git add translations/*_??.ts && git commit
-}
-
-ts.commands = \
- @echo \"The \'ts\' target has been removed in favor of more fine-grained targets.\" && \
- echo \"Use \'ts-<target>-<lang>\' or \'ts-<lang>\' instead. To add a language,\" && \
- echo \"use \'untranslated\' for <lang>, rename the files and re-run \'qmake\'.\"
-
-QMAKE_EXTRA_TARGETS += $$unique(TS_TARGETS) ts commit-ts check-ts
diff --git a/translations/translations.pro b/translations/translations.pro
index 14c1177d6c..311b032557 100644
--- a/translations/translations.pro
+++ b/translations/translations.pro
@@ -1,8 +1,86 @@
TRANSLATIONS = $$files(*.ts)
qtPrepareTool(LRELEASE, lrelease)
+qtPrepareTool(LCONVERT, lconvert)
+qtPrepareTool(LUPDATE, lupdate)
+LUPDATE += -locations relative -no-ui-lines
-contains(TEMPLATE_PREFIX, vc):vcproj = 1
+TS_TARGETS =
+
+# meta target name, target name, lupdate base options, files
+defineTest(addTsTarget) {
+ cv = $${2}.commands
+ $$cv = cd $$QT_SOURCE_TREE/src && $$LUPDATE $$3 -ts $$4
+ export($$cv)
+ dv = $${1}.depends
+ $$dv += $$2
+ export($$dv)
+ TS_TARGETS += $$1 $$2
+ export(TS_TARGETS)
+}
+
+# target basename, lupdate base options
+defineTest(addTsTargets) {
+ files = $$files($$PWD/$${1}_??.ts) $$files($$PWD/$${1}_??_??.ts)
+ for(file, files) {
+ lang = $$replace(file, .*_((.._)?..)\\.ts$, \\1)
+ addTsTarget(ts-$$lang, ts-$$1-$$lang, $$2, $$file)
+ }
+ addTsTarget(ts-untranslated, ts-$$1-untranslated, $$2, $$PWD/$${1}_untranslated.ts)
+ addTsTarget(ts-all, ts-$$1-all, $$2, $$PWD/$${1}_untranslated.ts $$files)
+}
+
+addTsTargets(qt, -I../include -I../include/Qt \
+ 3rdparty/phonon \
+ 3rdparty/webkit \
+ activeqt \
+ corelib \
+ declarative \
+ gui \
+ multimedia \
+ network \
+ opengl \
+ plugins \
+ qt3support \
+ script \
+ scripttools \
+ sql \
+ svg \
+ xml \
+ xmlpatterns \
+)
+addTsTargets(designer, ../tools/designer/designer.pro)
+addTsTargets(linguist, ../tools/linguist/linguist.pro)
+addTsTargets(assistant, ../tools/assistant/tools/tools.pro)
+addTsTargets(qt_help, ../tools/assistant/lib/lib.pro)
+addTsTargets(qtconfig, ../tools/qtconfig/qtconfig.pro)
+addTsTargets(qvfb, ../tools/qvfb/qvfb.pro)
+
+check-ts.commands = (cd $$PWD && perl check-ts.pl)
+check-ts.depends = ts-all
+
+isEqual(QMAKE_DIR_SEP, /) {
+ commit-ts.commands = \
+ cd $$PWD/..; \
+ for f in `git diff-files --name-only translations/*_??.ts`; do \
+ $$LCONVERT -locations none -i \$\$f -o \$\$f; \
+ done; \
+ git add translations/*_??.ts && git commit
+} else {
+ wd = $$replace(PWD, /, \\)\\..
+ commit-ts.commands = \
+ cd $$wd && \
+ for /f usebackq %%f in (`git diff-files --name-only translations/*_??.ts`) do \
+ $$LCONVERT -locations none -i %%f -o %%f $$escape_expand(\\n\\t) \
+ cd $$wd && git add translations/*_??.ts && git commit
+}
+
+ts.commands = \
+ @echo \"The \'ts\' target has been removed in favor of more fine-grained targets.\" && \
+ echo \"Use \'ts-<target>-<lang>\' or \'ts-<lang>\' instead. To add a language,\" && \
+ echo \"use \'untranslated\' for <lang>, rename the files and re-run \'qmake\'.\"
+
+QMAKE_EXTRA_TARGETS += $$unique(TS_TARGETS) ts commit-ts check-ts
TEMPLATE = app
TARGET = qm_phony_target
@@ -11,6 +89,8 @@ CONFIG += no_icon
QT =
LIBS =
+contains(TEMPLATE_PREFIX, vc):vcproj = 1
+
updateqm.input = TRANSLATIONS
updateqm.output = ${QMAKE_FILE_BASE}.qm
isEmpty(vcproj):updateqm.variable_out = PRE_TARGETDEPS