diff options
author | Tobias Hunger <tobias.hunger@digia.com> | 2014-09-26 13:55:14 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@digia.com> | 2014-09-29 12:10:50 +0200 |
commit | 3af3878ace09fedb98c495f9bda550f7aa0df39c (patch) | |
tree | 5434751dbfc28a99e95e472c01a1311331d61fc0 /share/qtcreator/translations/jsonwizard_tr.pro | |
parent | f39a86f70ea453df8ead15aea19b8775a066f3c7 (diff) |
JsonWizard: Make wizards translatable
Change-Id: Ia496829dd3070ef65b2cec31ecaf30955b2900c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'share/qtcreator/translations/jsonwizard_tr.pro')
-rw-r--r-- | share/qtcreator/translations/jsonwizard_tr.pro | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/share/qtcreator/translations/jsonwizard_tr.pro b/share/qtcreator/translations/jsonwizard_tr.pro new file mode 100644 index 0000000000..4bc9f6da91 --- /dev/null +++ b/share/qtcreator/translations/jsonwizard_tr.pro @@ -0,0 +1,36 @@ +TEMPLATE = subdirs + +isEmpty(JSONWIZARD_TR_H): JSONWIZARD_TR_H = $$OUT_PWD/jsonwizard_tr.h +isEmpty(TOP_LEVEL): TOP_LEVEL = "." + +for(dir, $$list($$files($$TOP_LEVEL/*, true))): \ + JSONWIZARD_FILES += $$files($$dir/wizard.json) + +defineReplace(findToTranslate) { + ROOTKEY = $$1 + OUTPUT = "" + for (KEY, $${ROOTKEY}._KEYS_) { + SUBKEY = $${ROOTKEY}.$${KEY} + MATCHED = $$find(KEY, ^tr[A-Z]) + !isEmpty(MATCHED) { + VALUE = $$eval($${SUBKEY}) + OUTPUT += "QCoreApplication(\"ProjectExplorer::JsonWizard\", \"$${VALUE}\");" + } + OUTPUT += $$findToTranslate($${SUBKEY}) + } + return($$OUTPUT) +} + +WIZ_TRANS_FILE_CONT= \ + "// This file is autogenerated by qmake." \ + "$${LITERAL_HASH}include <QCoreApplication>" + +for (FILE, JSONWIZARD_FILES) { + exists($$FILE) { + JSON = $$cat($$FILE, blob) + parseJson(JSON, WIZ) + WIZ_TRANS_FILE_CONT += $$findToTranslate(WIZ) + } +} + +write_file($$JSONWIZARD_TR_H, WIZ_TRANS_FILE_CONT)|error("Aborting") |