Commit a3cd6e79 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

clean up string extraction from xml files

parent b23e6b47
......@@ -53,8 +53,6 @@ Thumbs.db
*.Release
# translation related:
share/qtcreator/translations/extract-mimetypes.xq
share/qtcreator/translations/extract-customwizards.xq
# Directories to ignore
# ---------------------
......
let $files := ( $$CUSTOMWIZARD_FILES )
let $prefix := string(\"QT_TRANSLATE_NOOP("ProjectExplorer::CustomWizard", "\")
let $suffix := concat(\"")\", codepoints-to-string(10))
where empty($files)
return
for $file in $files
let $prefix := string("QT_TRANSLATE_NOOP("ProjectExplorer::CustomWizard", "")
let $suffix := concat("")", 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)
let $files := ( $$MIMETYPES_FILES )
let $prefix := string(\"QT_TRANSLATE_NOOP("MimeType", "\")
let $suffix := concat(\"")\", codepoints-to-string(10))
for $file in $files
let $prefix := string("QT_TRANSLATE_NOOP("MimeType", "")
let $suffix := concat("")", 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)
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment