aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/translations
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-07-16 15:08:46 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-07-16 16:35:27 +0200
commita3cd6e7923deee74745b790c66e687d79668e5c6 (patch)
treec52a76ffee5a9c62b0b75fcbeccd6e874be22856 /share/qtcreator/translations
parentb23e6b47d7638a92d77ba7a71d4892a3863d58a6 (diff)
clean up string extraction from xml files
Diffstat (limited to 'share/qtcreator/translations')
-rw-r--r--share/qtcreator/translations/extract-customwizards.xq (renamed from share/qtcreator/translations/extract-customwizards.xq.in)9
-rw-r--r--share/qtcreator/translations/extract-mimetypes.xq5
-rw-r--r--share/qtcreator/translations/extract-mimetypes.xq.in6
-rw-r--r--share/qtcreator/translations/translations.pro10
4 files changed, 12 insertions, 18 deletions
diff --git a/share/qtcreator/translations/extract-customwizards.xq.in b/share/qtcreator/translations/extract-customwizards.xq
index 2112c4be839..63e9887c48e 100644
--- a/share/qtcreator/translations/extract-customwizards.xq.in
+++ b/share/qtcreator/translations/extract-customwizards.xq
@@ -1,9 +1,6 @@
-let $files := ( $$CUSTOMWIZARD_FILES )
-let $prefix := string(\"QT_TRANSLATE_NOOP(&quot;ProjectExplorer::CustomWizard&quot;, &quot;\")
-let $suffix := concat(\"&quot;)\", codepoints-to-string(10))
-where empty($files)
-return
-for $file in $files
+let $prefix := string("QT_TRANSLATE_NOOP(&quot;ProjectExplorer::CustomWizard&quot;, &quot;")
+let $suffix := concat("&quot;)", codepoints-to-string(10))
+for $file in tokenize($files, string("\|"))
let $doc := doc($file)
for $text in ($doc/*:wizard/*:description, $doc/*:wizard/*:displayname, $doc/*:wizard/*:displaycategory, $doc/*:wizard/*:fieldpagetitle, $doc/*:wizard/*:fields/*:field/*:fielddescription)
return fn:concat($prefix, data($text), $suffix)
diff --git a/share/qtcreator/translations/extract-mimetypes.xq b/share/qtcreator/translations/extract-mimetypes.xq
new file mode 100644
index 00000000000..181d99d4991
--- /dev/null
+++ b/share/qtcreator/translations/extract-mimetypes.xq
@@ -0,0 +1,5 @@
+let $prefix := string("QT_TRANSLATE_NOOP(&quot;MimeType&quot;, &quot;")
+let $suffix := concat("&quot;)", codepoints-to-string(10))
+for $file in tokenize($files, string("\|"))
+ for $comment in doc($file)/*:mime-info/*:mime-type/*:comment
+ return fn:concat($prefix, data($comment), $suffix)
diff --git a/share/qtcreator/translations/extract-mimetypes.xq.in b/share/qtcreator/translations/extract-mimetypes.xq.in
deleted file mode 100644
index 8a4bb835f7d..00000000000
--- a/share/qtcreator/translations/extract-mimetypes.xq.in
+++ /dev/null
@@ -1,6 +0,0 @@
-let $files := ( $$MIMETYPES_FILES )
-let $prefix := string(\"QT_TRANSLATE_NOOP(&quot;MimeType&quot;, &quot;\")
-let $suffix := concat(\"&quot;)\", codepoints-to-string(10))
-for $file in $files
- for $comment in doc($file)/*:mime-info/*:mime-type/*:comment
- return fn:concat($prefix, data($comment), $suffix)
diff --git a/share/qtcreator/translations/translations.pro b/share/qtcreator/translations/translations.pro
index 831a8511704..8e1b9f7290a 100644
--- a/share/qtcreator/translations/translations.pro
+++ b/share/qtcreator/translations/translations.pro
@@ -19,16 +19,14 @@ MIME_TR_H = $$OUT_PWD/mime_tr.h
CUSTOMWIZARD_TR_H = $$OUT_PWD/customwizard_tr.h
for(dir, $$list($$files($$IDE_SOURCE_TREE/src/plugins/*))):MIMETYPES_FILES += $$files($$dir/*.mimetypes.xml)
-MIMETYPES_FILES = \"$$join(MIMETYPES_FILES, \", \")\"
+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, \", \")\"
+CUSTOMWIZARD_FILES = \"$$join(CUSTOMWIZARD_FILES, |)\"
-QMAKE_SUBSTITUTES += extract-mimetypes.xq.in
-QMAKE_SUBSTITUTES += extract-customwizards.xq.in
ts.commands += \
- $$XMLPATTERNS -output $$MIME_TR_H $$PWD/extract-mimetypes.xq && \
- $$XMLPATTERNS -output $$CUSTOMWIZARD_TR_H $$PWD/extract-customwizards.xq && \
+ $$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
QMAKE_EXTRA_TARGETS += ts