From efbe35787fc6b9825e26d85c22faa926d21f4e5d Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Sun, 6 May 2012 12:30:23 +0400 Subject: [PATCH] Translate editor display names in correct context. These strings were internationalized long ago, but wrong context prevented them from being actually tranlated in GUI. This patch won't break anything - if these strings were not translated for particular language, they stay untranslated, but if they were, translations are used (e.g. for RU). Change-Id: I175e29e8b0cee2bff9306623dad4a5956db69288 Reviewed-by: Friedemann Kleint Reviewed-by: Eike Ziller --- src/plugins/bineditor/bineditorplugin.cpp | 3 ++- src/plugins/cppeditor/cppplugin.cpp | 2 +- src/plugins/designer/formeditorfactory.cpp | 3 ++- .../genericprojectmanager/genericprojectfileseditor.cpp | 4 +++- src/plugins/glsleditor/glsleditorfactory.cpp | 3 ++- src/plugins/imageviewer/imageviewerfactory.cpp | 3 ++- src/plugins/qmljseditor/qmljseditorfactory.cpp | 3 ++- src/plugins/qt4projectmanager/profileeditorfactory.cpp | 3 ++- src/plugins/resourceeditor/resourceeditorfactory.cpp | 3 ++- src/plugins/texteditor/plaintexteditorfactory.cpp | 3 ++- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index 9a26c4a1cbe..2446a29543d 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -36,6 +36,7 @@ #include +#include #include #include #include @@ -423,7 +424,7 @@ Core::Id BinEditorFactory::id() const QString BinEditorFactory::displayName() const { - return tr(Constants::C_BINEDITOR_DISPLAY_NAME); + return qApp->translate("OpenWith::Editors", Constants::C_BINEDITOR_DISPLAY_NAME); } Core::IDocument *BinEditorFactory::open(const QString &fileName) diff --git a/src/plugins/cppeditor/cppplugin.cpp b/src/plugins/cppeditor/cppplugin.cpp index ca3476bd401..920c954696b 100644 --- a/src/plugins/cppeditor/cppplugin.cpp +++ b/src/plugins/cppeditor/cppplugin.cpp @@ -105,7 +105,7 @@ Core::Id CppEditorFactory::id() const QString CppEditorFactory::displayName() const { - return tr(CppEditor::Constants::CPPEDITOR_DISPLAY_NAME); + return qApp->translate("OpenWith::Editors", CppEditor::Constants::CPPEDITOR_DISPLAY_NAME); } Core::IDocument *CppEditorFactory::open(const QString &fileName) diff --git a/src/plugins/designer/formeditorfactory.cpp b/src/plugins/designer/formeditorfactory.cpp index 87bbb5fbcc5..323d15c0f3b 100644 --- a/src/plugins/designer/formeditorfactory.cpp +++ b/src/plugins/designer/formeditorfactory.cpp @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -68,7 +69,7 @@ Core::Id FormEditorFactory::id() const QString FormEditorFactory::displayName() const { - return tr(C_DESIGNER_XML_DISPLAY_NAME); + return qApp->translate("Designer", C_DESIGNER_XML_DISPLAY_NAME); } Core::IDocument *FormEditorFactory::open(const QString &fileName) diff --git a/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp b/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp index 68694545204..c9f3ddfd672 100644 --- a/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp +++ b/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp @@ -39,6 +39,8 @@ #include #include +#include + using namespace GenericProjectManager; using namespace GenericProjectManager::Internal; @@ -76,7 +78,7 @@ Core::Id ProjectFilesFactory::id() const QString ProjectFilesFactory::displayName() const { - return tr(Constants::FILES_EDITOR_DISPLAY_NAME); + return qApp->translate("OpenWith::Editors", Constants::FILES_EDITOR_DISPLAY_NAME); } Core::IDocument *ProjectFilesFactory::open(const QString &fileName) diff --git a/src/plugins/glsleditor/glsleditorfactory.cpp b/src/plugins/glsleditor/glsleditorfactory.cpp index 397e3922411..c58a67c0f9c 100644 --- a/src/plugins/glsleditor/glsleditorfactory.cpp +++ b/src/plugins/glsleditor/glsleditorfactory.cpp @@ -43,6 +43,7 @@ #include #include +#include #include #include #include @@ -72,7 +73,7 @@ Core::Id GLSLEditorFactory::id() const QString GLSLEditorFactory::displayName() const { - return tr(C_GLSLEDITOR_DISPLAY_NAME); + return qApp->translate("OpenWith::Editors", C_GLSLEDITOR_DISPLAY_NAME); } Core::IDocument *GLSLEditorFactory::open(const QString &fileName) diff --git a/src/plugins/imageviewer/imageviewerfactory.cpp b/src/plugins/imageviewer/imageviewerfactory.cpp index 74baf6b6012..851822b4d96 100644 --- a/src/plugins/imageviewer/imageviewerfactory.cpp +++ b/src/plugins/imageviewer/imageviewerfactory.cpp @@ -36,6 +36,7 @@ #include "imageviewerconstants.h" #include "imageviewer.h" +#include #include #include #include @@ -102,7 +103,7 @@ Core::Id ImageViewerFactory::id() const QString ImageViewerFactory::displayName() const { - return tr(Constants::IMAGEVIEWER_DISPLAY_NAME); + return qApp->translate("OpenWith::Editors", Constants::IMAGEVIEWER_DISPLAY_NAME); } Core::IDocument *ImageViewerFactory::open(const QString & /*fileName*/) diff --git a/src/plugins/qmljseditor/qmljseditorfactory.cpp b/src/plugins/qmljseditor/qmljseditorfactory.cpp index 42dfcabab6b..50c4bc4935a 100644 --- a/src/plugins/qmljseditor/qmljseditorfactory.cpp +++ b/src/plugins/qmljseditor/qmljseditorfactory.cpp @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -74,7 +75,7 @@ Core::Id QmlJSEditorFactory::id() const QString QmlJSEditorFactory::displayName() const { - return tr(C_QMLJSEDITOR_DISPLAY_NAME); + return qApp->translate("OpenWith::Editors", C_QMLJSEDITOR_DISPLAY_NAME); } diff --git a/src/plugins/qt4projectmanager/profileeditorfactory.cpp b/src/plugins/qt4projectmanager/profileeditorfactory.cpp index 20dea318966..47ac3af1eff 100644 --- a/src/plugins/qt4projectmanager/profileeditorfactory.cpp +++ b/src/plugins/qt4projectmanager/profileeditorfactory.cpp @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -75,7 +76,7 @@ Core::Id ProFileEditorFactory::id() const QString ProFileEditorFactory::displayName() const { - return tr(Qt4ProjectManager::Constants::PROFILE_EDITOR_DISPLAY_NAME); + return qApp->translate("OpenWith::Editors", Qt4ProjectManager::Constants::PROFILE_EDITOR_DISPLAY_NAME); } Core::IDocument *ProFileEditorFactory::open(const QString &fileName) diff --git a/src/plugins/resourceeditor/resourceeditorfactory.cpp b/src/plugins/resourceeditor/resourceeditorfactory.cpp index 30f25de2e40..952a9def2b6 100644 --- a/src/plugins/resourceeditor/resourceeditorfactory.cpp +++ b/src/plugins/resourceeditor/resourceeditorfactory.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -61,7 +62,7 @@ Core::Id ResourceEditorFactory::id() const QString ResourceEditorFactory::displayName() const { - return tr(C_RESOURCEEDITOR_DISPLAY_NAME); + return qApp->translate("OpenWith::Editors", C_RESOURCEEDITOR_DISPLAY_NAME); } Core::IDocument *ResourceEditorFactory::open(const QString &fileName) diff --git a/src/plugins/texteditor/plaintexteditorfactory.cpp b/src/plugins/texteditor/plaintexteditorfactory.cpp index 308819e11bf..ac86038ac6d 100644 --- a/src/plugins/texteditor/plaintexteditorfactory.cpp +++ b/src/plugins/texteditor/plaintexteditorfactory.cpp @@ -44,6 +44,7 @@ #include #include +#include #include using namespace TextEditor; @@ -72,7 +73,7 @@ Core::Id PlainTextEditorFactory::id() const QString PlainTextEditorFactory::displayName() const { - return tr(Core::Constants::K_DEFAULT_TEXT_EDITOR_DISPLAY_NAME); + return qApp->translate("OpenWith::Editors", Core::Constants::K_DEFAULT_TEXT_EDITOR_DISPLAY_NAME); } Core::IDocument *PlainTextEditorFactory::open(const QString &fileName)