forked from qt-creator/qt-creator
Fix translation of external tools.
Change-Id: I21541c579f3be75537763ad65b63f6804c329e50 Reviewed-on: http://codereview.qt.nokia.com/2951 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
committed by
Oswald Buddenhagen
parent
6958fbbe68
commit
47f6cb398a
@@ -0,0 +1,6 @@
|
||||
let $prefix := string("QT_TRANSLATE_NOOP("Core::Internal::ExternalTool", "")
|
||||
let $suffix := concat("")", codepoints-to-string(10))
|
||||
for $file in tokenize($files, string("\|"))
|
||||
let $doc := doc($file)
|
||||
for $text in ($doc/*:externaltool/*:description, $doc/*:externaltool/*:displayname, $doc/*:externaltool/*:category)
|
||||
return fn:concat($prefix, data($text), $suffix)
|
||||
@@ -19,6 +19,7 @@ TRANSLATIONS = $$prependAll(LANGUAGES, $$PWD/qtcreator_,.ts)
|
||||
|
||||
MIME_TR_H = $$OUT_PWD/mime_tr.h
|
||||
CUSTOMWIZARD_TR_H = $$OUT_PWD/customwizard_tr.h
|
||||
EXTERNALTOOLS_TR_H = $$OUT_PWD/externaltools_tr.h
|
||||
|
||||
for(dir, $$list($$files($$IDE_SOURCE_TREE/src/plugins/*))):MIMETYPES_FILES += $$files($$dir/*.mimetypes.xml)
|
||||
MIMETYPES_FILES = \"$$join(MIMETYPES_FILES, |)\"
|
||||
@@ -26,9 +27,13 @@ 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, |)\"
|
||||
|
||||
for(file, $$list($$files($$IDE_SOURCE_TREE/src/share/qtcreator/externaltools/*))):EXTERNALTOOLS_FILES += $$files($$file)
|
||||
EXTERNALTOOLS_FILES = \"$$join(EXTERNALTOOLS_FILES, |)\"
|
||||
|
||||
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
|
||||
$$XMLPATTERNS -output $$CUSTOMWIZARD_TR_H -param files=$$CUSTOMWIZARD_FILES $$PWD/extract-customwizards.xq $$escape_expand(\\n\\t) \
|
||||
$$XMLPATTERNS -output $$EXTERNALTOOLS_TR_H -param files=$$EXTERNALTOOLS_FILES $$PWD/extract-externaltools.xq
|
||||
QMAKE_EXTRA_TARGETS += extract
|
||||
|
||||
plugin_sources = $$files($$IDE_SOURCE_TREE/src/plugins/*)
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include <utils/environment.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QXmlStreamReader>
|
||||
#include <QtCore/QXmlStreamWriter>
|
||||
#include <QtCore/QDir>
|
||||
@@ -316,7 +317,8 @@ static void localizedText(const QStringList &locales, QXmlStreamReader *reader,
|
||||
}
|
||||
} else {
|
||||
if (*currentLocale < 0 && currentText->isEmpty()) {
|
||||
*currentText = reader->readElementText();
|
||||
*currentText = QCoreApplication::translate("Core::Internal::ExternalTool",
|
||||
reader->readElementText().toLatin1().constData());
|
||||
} else {
|
||||
reader->skipCurrentElement();
|
||||
}
|
||||
|
||||
@@ -31,11 +31,8 @@
|
||||
-->
|
||||
<externaltool id="lrelease">
|
||||
<description>Creates qm translation files that can be used by an application from the translator's ts files</description>
|
||||
<description xml:lang="de">Erstellt die von Anwendungen nutzbaren qm-Dateien aus ts-Dateien von Übersetzern</description>
|
||||
<displayname>Release Translations (lrelease)</displayname>
|
||||
<displayname xml:lang="de">Übersetzungen veröffentlichen (lrelease)</displayname>
|
||||
<category>Linguist</category>
|
||||
<category xml:lang="de">Linguist</category>
|
||||
<order>2</order>
|
||||
<executable>
|
||||
<path>%{CurrentProject:QT_INSTALL_BINS}/lrelease</path>
|
||||
|
||||
@@ -31,11 +31,8 @@
|
||||
-->
|
||||
<externaltool id="lupdate">
|
||||
<description>Synchronizes translator's ts files with the program code</description>
|
||||
<description xml:lang="de">Synchronisiert die ts-Übersetzungsdateien mit dem Programmcode</description>
|
||||
<displayname>Update Translations (lupdate)</displayname>
|
||||
<displayname xml:lang="de">Übersetzungen aktualisieren (lupdate)</displayname>
|
||||
<category>Linguist</category>
|
||||
<category xml:lang="de">Linguist</category>
|
||||
<order>1</order>
|
||||
<executable>
|
||||
<path>%{CurrentProject:QT_INSTALL_BINS}/lupdate</path>
|
||||
|
||||
@@ -31,11 +31,8 @@
|
||||
-->
|
||||
<externaltool id="notepad">
|
||||
<description>Opens the current file in Notepad</description>
|
||||
<description xml:lang="de">Öffnet die aktuelle Datei in Notepad</description>
|
||||
<displayname>Edit with Notepad</displayname>
|
||||
<displayname xml:lang="de">In Notepad öffnen</displayname>
|
||||
<category>Text</category>
|
||||
<category xml:lang="de">Text</category>
|
||||
<executable modifiesdocument="yes">
|
||||
<path>notepad</path>
|
||||
<arguments>"%{CurrentDocument:FilePath}"</arguments>
|
||||
|
||||
@@ -31,11 +31,8 @@
|
||||
-->
|
||||
<externaltool id="sort">
|
||||
<description>Sorts the selected text</description>
|
||||
<description xml:lang="de">Sortiert den ausgewählten Text</description>
|
||||
<displayname>Sort Selection</displayname>
|
||||
<displayname xml:lang="de">Auswahl Sortieren</displayname>
|
||||
<category>Text</category>
|
||||
<category xml:lang="de">Text</category>
|
||||
<executable output="replaceselection" error="ignore">
|
||||
<path>sort</path>
|
||||
<input>%{CurrentDocument:Selection}</input>
|
||||
|
||||
@@ -31,11 +31,8 @@
|
||||
-->
|
||||
<externaltool id="vi">
|
||||
<description>Opens the current file in vi</description>
|
||||
<description xml:lang="de">Öffnet die aktuelle Datei in vi</description>
|
||||
<displayname>Edit with vi</displayname>
|
||||
<displayname xml:lang="de">In vi öffnen</displayname>
|
||||
<category>Text</category>
|
||||
<category xml:lang="de">Text</category>
|
||||
<executable modifiesdocument="yes">
|
||||
<path>xterm</path>
|
||||
<arguments>-geom %{CurrentDocument:ColumnCount}x%{CurrentDocument:RowCount}+%{CurrentDocument:XPos}+%{CurrentDocument:YPos} -e vi "%{CurrentDocument:FilePath}" +%{CurrentDocument:Row}</arguments>
|
||||
|
||||
@@ -31,11 +31,8 @@
|
||||
-->
|
||||
<externaltool id="vi">
|
||||
<description>Opens the current file in vi</description>
|
||||
<description xml:lang="de">Öffnet die aktuelle Datei in vi</description>
|
||||
<displayname>Edit with vi</displayname>
|
||||
<displayname xml:lang="de">In vi öffnen</displayname>
|
||||
<category>Text</category>
|
||||
<category xml:lang="de">Text</category>
|
||||
<executable modifiesdocument="yes">
|
||||
<path>osascript</path>
|
||||
<input>
|
||||
|
||||
Reference in New Issue
Block a user