OSDN Git Service

add fine-grained ts-<lang> targets
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Fri, 16 Jul 2010 12:51:37 +0000 (14:51 +0200)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Fri, 16 Jul 2010 14:39:51 +0000 (16:39 +0200)
the old ts target is now named ts-all, and it will update even the files
which are disabled from compilation/release.

.gitignore
share/qtcreator/translations/translations.pro

index b171475..376aadb 100644 (file)
@@ -53,6 +53,7 @@ Thumbs.db
 *.Release
 
 # translation related:
+share/qtcreator/translations/*_tr.h
 
 # Directories to ignore
 # ---------------------
index 8e1b9f7..9e3389b 100644 (file)
@@ -24,11 +24,27 @@ MIMETYPES_FILES = \"$$join(MIMETYPES_FILES, |)\"
 for(dir, $$list($$files($$IDE_SOURCE_TREE/share/qtcreator/templates/wizards/*))):CUSTOMWIZARD_FILES += $$files($$dir/wizard.xml)
 CUSTOMWIZARD_FILES = \"$$join(CUSTOMWIZARD_FILES, |)\"
 
-ts.commands += \
+extract.commands += \
     $$XMLPATTERNS -output $$MIME_TR_H -param files=$$MIMETYPES_FILES $$PWD/extract-mimetypes.xq $$escape_expand(\\n\\t) \
-    $$XMLPATTERNS -output $$CUSTOMWIZARD_TR_H -param files=$$CUSTOMWIZARD_FILES $$PWD/extract-customwizards.xq $$escape_expand(\\n\\t) \
-    (cd $$IDE_SOURCE_TREE && $$LUPDATE src share/qtcreator/qmldesigner $$MIME_TR_H $$CUSTOMWIZARD_TR_H -ts $$TRANSLATIONS) && \
-    $$QMAKE_DEL_FILE $$MIME_TR_H
+    $$XMLPATTERNS -output $$CUSTOMWIZARD_TR_H -param files=$$CUSTOMWIZARD_FILES $$PWD/extract-customwizards.xq
+QMAKE_EXTRA_TARGETS += extract
+
+files = $$files($$PWD/*_??.ts)
+for(file, files) {
+    lang = $$replace(file, .*_(.*)\\.ts, \\1)
+    v = ts-$${lang}.commands
+    $$v = cd $$IDE_SOURCE_TREE && $$LUPDATE src share/qtcreator/qmldesigner $$MIME_TR_H $$CUSTOMWIZARD_TR_H -ts $$file
+    v = ts-$${lang}.depends
+    $$v = extract
+    QMAKE_EXTRA_TARGETS += ts-$$lang
+}
+ts-all.commands = cd $$IDE_SOURCE_TREE && $$LUPDATE src share/qtcreator/qmldesigner $$MIME_TR_H $$CUSTOMWIZARD_TR_H -ts $$files
+ts-all.depends = extract
+QMAKE_EXTRA_TARGETS += ts-all
+
+ts.commands = \
+    @echo \"The \'ts\' target has been removed in favor of more fine-grained targets.\" && \
+    echo \"Use \'ts-<lang>\' instead.\"
 QMAKE_EXTRA_TARGETS += ts
 
 TEMPLATE = app