summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-07-13 10:55:31 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-07-15 20:00:28 (GMT)
commit807bc3aca8a0b07ee1dfe1e398044d32756e5de0 (patch)
treedd5dbd2de37ef581f2bbb0f9446f9b96bc185bfa
parentb863daec96868731412bd8f89b960bc7395911ae (diff)
downloadQt-807bc3aca8a0b07ee1dfe1e398044d32756e5de0.zip
Qt-807bc3aca8a0b07ee1dfe1e398044d32756e5de0.tar.gz
Qt-807bc3aca8a0b07ee1dfe1e398044d32756e5de0.tar.bz2
more fine-grained ts targets
there are now per-language ts-<package>-<lang> and ts-<lang> targets to update only the files relevant for a given language. there is also a ts-all target which does what the old ts target did. the ts-<package> targets are now named ts-<package>-all and should not be used manually - they exist for the convenience of the ts-all target. the ts target is now only a help blurb.
-rw-r--r--tools/assistant/lib/lib.pro13
-rw-r--r--tools/assistant/tools/assistant/assistant.pro13
-rw-r--r--tools/designer/designer.pro13
-rw-r--r--tools/linguist/linguist/linguist.pro12
-rw-r--r--tools/qtconfig/qtconfig.pro8
-rw-r--r--tools/qvfb/qvfb.pro8
-rw-r--r--translations/translations.pri132
7 files changed, 56 insertions, 143 deletions
diff --git a/tools/assistant/lib/lib.pro b/tools/assistant/lib/lib.pro
index e84cf31..26d3456 100644
--- a/tools/assistant/lib/lib.pro
+++ b/tools/assistant/lib/lib.pro
@@ -69,16 +69,3 @@ HEADERS += qhelpenginecore.h \
# access to clucene
HEADERS += qhelpsearchindexwriter_clucene_p.h \
qhelpsearchindexreader_clucene_p.h
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
- $$TR_DIR/qt_help_cs.ts \
- $$TR_DIR/qt_help_da.ts \
- $$TR_DIR/qt_help_de.ts \
- $$TR_DIR/qt_help_hu.ts \
- $$TR_DIR/qt_help_ja.ts \
- $$TR_DIR/qt_help_pl.ts \
- $$TR_DIR/qt_help_ru.ts \
- $$TR_DIR/qt_help_zh_CN.ts \
- $$TR_DIR/qt_help_zh_TW.ts \
- $$TR_DIR/qt_help_fr.ts
diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro
index 16a520e..d9aff7a 100644
--- a/tools/assistant/tools/assistant/assistant.pro
+++ b/tools/assistant/tools/assistant/assistant.pro
@@ -108,16 +108,3 @@ contains(CONFIG, static): {
DEFINES += USE_STATIC_SQLITE_PLUGIN
}
}
-
-TR_DIR = $$PWD/../../../../translations
-TRANSLATIONS = \
- $$TR_DIR/assistant_cs.ts \
- $$TR_DIR/assistant_da.ts \
- $$TR_DIR/assistant_de.ts \
- $$TR_DIR/assistant_fr.ts \
- $$TR_DIR/assistant_hu.ts \
- $$TR_DIR/assistant_ja.ts \
- $$TR_DIR/assistant_pl.ts \
- $$TR_DIR/assistant_ru.ts \
- $$TR_DIR/assistant_zh_CN.ts \
- $$TR_DIR/assistant_zh_TW.ts
diff --git a/tools/designer/designer.pro b/tools/designer/designer.pro
index 31c8622..721c4fc 100644
--- a/tools/designer/designer.pro
+++ b/tools/designer/designer.pro
@@ -3,16 +3,3 @@ TEMPLATE = subdirs
CONFIG += qt
SUBDIRS = src
-
-TR_DIR = $$PWD/../../translations
-TRANSLATIONS = \
- $$TR_DIR/designer_cs.ts \
- $$TR_DIR/designer_de.ts \
- $$TR_DIR/designer_fr.ts \
- $$TR_DIR/designer_hu.ts \
- $$TR_DIR/designer_ja.ts \
- $$TR_DIR/designer_pl.ts \
- $$TR_DIR/designer_ru.ts \
- $$TR_DIR/designer_sl.ts \
- $$TR_DIR/designer_zh_CN.ts \
- $$TR_DIR/designer_zh_TW.ts
diff --git a/tools/linguist/linguist/linguist.pro b/tools/linguist/linguist/linguist.pro
index 4f7ed8a..ce8d585 100644
--- a/tools/linguist/linguist/linguist.pro
+++ b/tools/linguist/linguist/linguist.pro
@@ -94,15 +94,3 @@ FORMS += statistics.ui \
translationsettings.ui \
finddialog.ui
RESOURCES += linguist.qrc
-
-TR_DIR = $$PWD/../../../translations
-TRANSLATIONS = \
- $$TR_DIR/linguist_cs.ts \
- $$TR_DIR/linguist_de.ts \
- $$TR_DIR/linguist_fr.ts \
- $$TR_DIR/linguist_hu.ts \
- $$TR_DIR/linguist_ja.ts \
- $$TR_DIR/linguist_pl.ts \
- $$TR_DIR/linguist_ru.ts \
- $$TR_DIR/linguist_zh_CN.ts \
- $$TR_DIR/linguist_zh_TW.ts
diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro
index 3a24e85..d1fd320 100644
--- a/tools/qtconfig/qtconfig.pro
+++ b/tools/qtconfig/qtconfig.pro
@@ -29,11 +29,3 @@ target.path=$$[QT_INSTALL_BINS]
INSTALLS += target
INCLUDEPATH += .
DBFILE = qtconfig.db
-
-TR_DIR = $$PWD/../../translations
-TRANSLATIONS = \
- $$TR_DIR/qtconfig_hu.ts \
- $$TR_DIR/qtconfig_pl.ts \
- $$TR_DIR/qtconfig_ru.ts \
- $$TR_DIR/qtconfig_zh_CN.ts \
- $$TR_DIR/qtconfig_zh_TW.ts
diff --git a/tools/qvfb/qvfb.pro b/tools/qvfb/qvfb.pro
index df69817..c101d00 100644
--- a/tools/qvfb/qvfb.pro
+++ b/tools/qvfb/qvfb.pro
@@ -62,11 +62,3 @@ unix:x11 {
}
RESOURCES += qvfb.qrc
-
-TR_DIR = $$PWD/../../translations
-TRANSLATIONS = \
- $$TR_DIR/qvfb_hu.ts \
- $$TR_DIR/qvfb_pl.ts \
- $$TR_DIR/qvfb_ru.ts \
- $$TR_DIR/qvfb_zh_CN.ts \
- $$TR_DIR/qvfb_zh_TW.ts
diff --git a/translations/translations.pri b/translations/translations.pri
index 6a13dff..b41f2a0 100644
--- a/translations/translations.pri
+++ b/translations/translations.pri
@@ -1,84 +1,64 @@
-defineReplace(prependAll) {
- prepend = $$1
- arglist = $$2
- append = $$3
- for(a,arglist) {
- result += $${prepend}$${a}$${append}
- }
- return ($$result)
-}
-
qtPrepareTool(LUPDATE, lupdate)
LUPDATE += -locations relative -no-ui-lines
-###### Qt Libraries
-
-QT_TS = ar cs da de es fr he hu ja pl pt ru sk sl sv uk zh_CN zh_TW
-
-ts-qt.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- -I../include -I../include/Qt \
- 3rdparty/phonon \
- 3rdparty/webkit \
- activeqt \
- corelib \
- declarative \
- gui \
- multimedia \
- network \
- opengl \
- plugins \
- qt3support \
- script \
- scripttools \
- sql \
- svg \
- xml \
- xmlpatterns \
- -ts $$prependAll($$QT_SOURCE_TREE/translations/qt_,$$QT_TS,.ts))
-ts-qt.depends = sub-tools
-
-###### Designer
-
-ts-designer.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- ../tools/designer/designer.pro)
-ts-designer.depends = sub-tools
-
-###### Linguist
-
-ts-linguist.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- ../tools/linguist/linguist/linguist.pro)
-ts-linguist.depends = sub-tools
-
-###### Assistant
-
-ts-assistant.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- ../tools/assistant/tools/assistant/assistant.pro)
-ts-assistant.depends = sub-tools
-
-###### Qt Help Lib
-
-ts-qt_help.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- ../tools/assistant/lib/lib.pro)
-ts-qt_help.depends = sub-tools
-
-###### Qtconfig
-
-ts-qtconfig.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- ../tools/qtconfig/qtconfig.pro)
-ts-qtconfig.depends = sub-tools
-
-###### Qvfp
-
-ts-qvfb.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
- ../tools/qvfb/qvfb.pro)
-ts-qvfb.depends = sub-tools
+TS_TARGETS =
+
+# meta target name, target name, lupdate base options, files
+defineTest(addTsTarget) {
+ cv = $${2}.commands
+ dv = $${2}.depends
+ $$cv = cd $$QT_SOURCE_TREE/src && $$LUPDATE $$3 -ts $$4
+ $$dv = sub-tools
+ export($$cv)
+ export($$dv)
+ dv = $${1}.depends
+ $$dv += $$2
+ export($$dv)
+ TS_TARGETS += $$1 $$2
+ export(TS_TARGETS)
+}
-###### Overall Rules
+# 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-all, ts-$$1-all, $$2, $$files)
+}
-ts.depends = ts-qt ts-designer ts-linguist ts-assistant ts-qt_help ts-qtconfig ts-qvfb
+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/linguist.pro)
+addTsTargets(assistant, ../tools/assistant/tools/assistant/assistant.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
+check-ts.depends = ts-all
+
+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.\"
-QMAKE_EXTRA_TARGETS += ts-qt ts-designer ts-linguist ts-assistant ts-qt_help ts-qtconfig ts-qvfb \
- ts check-ts
+QMAKE_EXTRA_TARGETS += $$unique(TS_TARGETS) ts check-ts