From 3c0fa16b07d49ba5ad196b47c3fc4186684a2203 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint <Friedemann.Kleint@nokia.com> Date: Wed, 31 Mar 2010 16:55:57 +0200 Subject: [PATCH] i18n: Add custom wizards. For the custom wizards shipped by Nokia, extract their message strings and add them to Qt Creator's ts files. --- share/qtcreator/translations/extract-customwizards.xq.in | 7 +++++++ share/qtcreator/translations/translations.pro | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 share/qtcreator/translations/extract-customwizards.xq.in diff --git a/share/qtcreator/translations/extract-customwizards.xq.in b/share/qtcreator/translations/extract-customwizards.xq.in new file mode 100644 index 00000000000..0511c217d48 --- /dev/null +++ b/share/qtcreator/translations/extract-customwizards.xq.in @@ -0,0 +1,7 @@ +let $files := ( $$CUSTOMWIZARD_FILES ) +let $prefix := string(\"QT_TRANSLATE_NOOP("ProjectExplorer::CustomWizard", "\") +let $suffix := concat(\"")\", codepoints-to-string(10)) +for $file in $files + 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/translations.pro b/share/qtcreator/translations/translations.pro index 93ab21bd2b9..d15586009a6 100644 --- a/share/qtcreator/translations/translations.pro +++ b/share/qtcreator/translations/translations.pro @@ -15,16 +15,23 @@ LRELEASE = $$targetPath($$[QT_INSTALL_BINS]/lrelease) TRANSLATIONS = $$prependAll(LANGUAGES, $$PWD/qtcreator_,.ts) MIME_TR_H = $$IDE_DATA_PATH/translations/mime_tr.h +CUSTOMWIZARD_TR_H = $$IDE_DATA_PATH/translations/customwizard_tr.h contains(QT_VERSION, ^4\.[0-6]\..*) { ts.commands = @echo This Qt version is too old for the ts target. Need Qt 4.7+. } else { for(dir, $$list($$files($$IDE_SOURCE_TREE/src/plugins/*))):MIMETYPES_FILES += $$files($$dir/*.mimetypes.xml) 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, \", \")\" + QMAKE_SUBSTITUTES += extract-mimetypes.xq.in + QMAKE_SUBSTITUTES += extract-customwizards.xq.in ts.commands += \ $$XMLPATTERNS -output $$MIME_TR_H $$PWD/extract-mimetypes.xq && \ - (cd $$IDE_SOURCE_TREE && $$LUPDATE src share/qtcreator/qmldesigner $$MIME_TR_H -ts $$TRANSLATIONS) && \ + $$XMLPATTERNS -output $$CUSTOMWIZARD_TR_H $$PWD/extract-customwizards.xq && \ + (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 -- GitLab