summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2023-02-09 11:43:49 +0100
committerAlessandro Portale <alessandro.portale@qt.io>2023-02-10 16:27:37 +0000
commit226799858c8a0da51f7f0b99b83308c60f30a288 (patch)
tree8fce92dd1e5db5b024a55c656cd1a8ca17ee2f61
parent14280acfd956264d15a92c2976d65e5813836d32 (diff)
downloadqt-creator-226799858c8a0da51f7f0b99b83308c60f30a288.tar.gz
Translations: Replace QCoreApplication::translate() with Tr::tr()
Calling <Module>::Tr::tr() is preferred over QCoreApplication::translate("::<Module>", "..."). This changes occurrences in .cpp files. Change-Id: I3311ef0dbf3e7d105a3f181b6b988f3b444468f1 Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/libs/advanceddockingsystem/dockmanager.cpp5
-rw-r--r--src/plugins/clangcodemodel/clangdlocatorfilters.cpp14
-rw-r--r--src/plugins/clangtools/settingswidget.cpp5
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildstep.cpp3
-rw-r--r--src/plugins/coreplugin/externaltool.cpp4
-rw-r--r--src/plugins/coreplugin/fileutils.cpp4
-rw-r--r--src/plugins/coreplugin/locator/locatorsettingspage.cpp3
-rw-r--r--src/plugins/cppcheck/cppcheckoptions.cpp3
-rw-r--r--src/plugins/cppeditor/cppcurrentdocumentfilter.cpp4
-rw-r--r--src/plugins/debugger/console/console.cpp4
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp6
-rw-r--r--src/plugins/designer/formeditorplugin.cpp4
-rw-r--r--src/plugins/designer/formtemplatewizardpage.cpp6
-rw-r--r--src/plugins/docker/dockerdevice.cpp3
-rw-r--r--src/plugins/help/helpwidget.cpp17
-rw-r--r--src/plugins/languageclient/languageclientoutline.cpp4
-rw-r--r--src/plugins/perfprofiler/perfoptionspage.cpp3
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp4
-rw-r--r--src/plugins/projectexplorer/projectwindow.cpp7
-rw-r--r--src/plugins/qmldesigner/qmldesignerplugin.cpp5
-rw-r--r--src/plugins/qmlprofiler/qmlprofilersettings.cpp3
-rw-r--r--src/plugins/qtsupport/codegensettingspage.cpp4
-rw-r--r--src/plugins/texteditor/snippets/snippetscollection.cpp2
-rw-r--r--src/plugins/valgrind/valgrindconfigwidget.cpp3
-rw-r--r--src/plugins/vcsbase/basevcseditorfactory.cpp5
-rw-r--r--src/plugins/vcsbase/vcsbasesubmiteditor.cpp2
26 files changed, 59 insertions, 68 deletions
diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp
index 44bbc5ffdb..1be298ef9c 100644
--- a/src/libs/advanceddockingsystem/dockmanager.cpp
+++ b/src/libs/advanceddockingsystem/dockmanager.cpp
@@ -17,6 +17,7 @@
#include <utils/algorithm.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
+#include <utils/utilstr.h>
#include <algorithm>
#include <iostream>
@@ -951,9 +952,7 @@ namespace ADS
QString errorString;
const bool success = write(workspace, data, &errorString);
if (!success)
- QMessageBox::critical(parent,
- QCoreApplication::translate("::Utils", "File Error"),
- errorString);
+ QMessageBox::critical(parent, ::Utils::Tr::tr("File Error"), errorString);
return success;
}
diff --git a/src/plugins/clangcodemodel/clangdlocatorfilters.cpp b/src/plugins/clangcodemodel/clangdlocatorfilters.cpp
index ed80fc1a5c..725d961591 100644
--- a/src/plugins/clangcodemodel/clangdlocatorfilters.cpp
+++ b/src/plugins/clangcodemodel/clangdlocatorfilters.cpp
@@ -7,6 +7,7 @@
#include "clangmodelmanagersupport.h"
#include <cppeditor/cppeditorconstants.h>
+#include <cppeditor/cppeditortr.h>
#include <cppeditor/cpplocatorfilter.h>
#include <cppeditor/cppmodelmanager.h>
#include <cppeditor/indexitem.h>
@@ -122,8 +123,7 @@ ClangGlobalSymbolFilter::ClangGlobalSymbolFilter(ILocatorFilter *cppFilter,
: m_cppFilter(cppFilter), m_lspFilter(lspFilter)
{
setId(CppEditor::Constants::LOCATOR_FILTER_ID);
- setDisplayName(QCoreApplication::translate("::CppEditor",
- CppEditor::Constants::LOCATOR_FILTER_DISPLAY_NAME));
+ setDisplayName(::CppEditor::Tr::tr(CppEditor::Constants::LOCATOR_FILTER_DISPLAY_NAME));
setDefaultShortcutString(":");
setDefaultIncludedByDefault(false);
}
@@ -186,8 +186,7 @@ ClangClassesFilter::ClangClassesFilter()
: ClangGlobalSymbolFilter(new CppClassesFilter, new LspClassesFilter)
{
setId(CppEditor::Constants::CLASSES_FILTER_ID);
- setDisplayName(QCoreApplication::translate("::CppEditor",
- CppEditor::Constants::CLASSES_FILTER_DISPLAY_NAME));
+ setDisplayName(::CppEditor::Tr::tr(CppEditor::Constants::CLASSES_FILTER_DISPLAY_NAME));
setDefaultShortcutString("c");
setDefaultIncludedByDefault(false);
}
@@ -196,8 +195,7 @@ ClangFunctionsFilter::ClangFunctionsFilter()
: ClangGlobalSymbolFilter(new CppFunctionsFilter, new LspFunctionsFilter)
{
setId(CppEditor::Constants::FUNCTIONS_FILTER_ID);
- setDisplayName(QCoreApplication::translate("::CppEditor",
- CppEditor::Constants::FUNCTIONS_FILTER_DISPLAY_NAME));
+ setDisplayName(::CppEditor::Tr::tr(CppEditor::Constants::FUNCTIONS_FILTER_DISPLAY_NAME));
setDefaultShortcutString("m");
setDefaultIncludedByDefault(false);
}
@@ -253,9 +251,7 @@ public:
ClangdCurrentDocumentFilter::ClangdCurrentDocumentFilter() : d(new Private)
{
setId(CppEditor::Constants::CURRENT_DOCUMENT_FILTER_ID);
- setDisplayName(
- QCoreApplication::translate("::CppEditor",
- CppEditor::Constants::CURRENT_DOCUMENT_FILTER_DISPLAY_NAME));
+ setDisplayName(::CppEditor::Tr::tr(CppEditor::Constants::CURRENT_DOCUMENT_FILTER_DISPLAY_NAME));
setDefaultShortcutString(".");
setPriority(High);
setDefaultIncludedByDefault(false);
diff --git a/src/plugins/clangtools/settingswidget.cpp b/src/plugins/clangtools/settingswidget.cpp
index bbac5aa706..76f915dd99 100644
--- a/src/plugins/clangtools/settingswidget.cpp
+++ b/src/plugins/clangtools/settingswidget.cpp
@@ -12,12 +12,11 @@
#include <cppeditor/clangdiagnosticconfigsselectionwidget.h>
#include <debugger/analyzer/analyzericons.h>
+#include <debugger/debuggertr.h>
#include <utils/layoutbuilder.h>
#include <utils/pathchooser.h>
-#include <QCoreApplication>
-
using namespace CppEditor;
using namespace Utils;
@@ -116,7 +115,7 @@ ClangToolsOptionsPage::ClangToolsOptionsPage()
setId(Constants::SETTINGS_PAGE_ID);
setDisplayName(Tr::tr("Clang Tools"));
setCategory("T.Analyzer");
- setDisplayCategory(QCoreApplication::translate("::Debugger", "Analyzer"));
+ setDisplayCategory(::Debugger::Tr::tr("Analyzer"));
setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);
setWidgetCreator([] { return new SettingsWidget; });
}
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
index e37e40337d..ccb21ccfb3 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
@@ -22,6 +22,7 @@
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/projectexplorertr.h>
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/target.h>
#include <projectexplorer/xcodebuildparser.h>
@@ -246,7 +247,7 @@ bool CMakeBuildStep::init()
RunConfiguration *rc = target()->activeRunConfiguration();
if (!rc || rc->buildKey().isEmpty()) {
emit addTask(BuildSystemTask(Task::Error,
- QCoreApplication::translate("::ProjectExplorer",
+ ::ProjectExplorer::Tr::tr(
"You asked to build the current Run Configuration's build target only, "
"but it is not associated with a build target. "
"Update the Make Step in your build settings.")));
diff --git a/src/plugins/coreplugin/externaltool.cpp b/src/plugins/coreplugin/externaltool.cpp
index bfac272b3d..0c0b1d8926 100644
--- a/src/plugins/coreplugin/externaltool.cpp
+++ b/src/plugins/coreplugin/externaltool.cpp
@@ -308,9 +308,7 @@ static void localizedText(const QStringList &locales, QXmlStreamReader *reader,
}
} else {
if (*currentLocale < 0 && currentText->isEmpty()) {
- *currentText = QCoreApplication::translate("::Core",
- reader->readElementText().toUtf8().constData(),
- "");
+ *currentText = Tr::tr(reader->readElementText().toUtf8().constData(), "");
} else {
reader->skipCurrentElement();
}
diff --git a/src/plugins/coreplugin/fileutils.cpp b/src/plugins/coreplugin/fileutils.cpp
index 05aeb219b2..6c78348897 100644
--- a/src/plugins/coreplugin/fileutils.cpp
+++ b/src/plugins/coreplugin/fileutils.cpp
@@ -78,7 +78,7 @@ void FileUtils::showInGraphicalShell(QWidget *parent, const FilePath &pathIn)
UnixUtils::substituteFileBrowserParameters(app, folder));
QString error;
if (browserArgs.isEmpty()) {
- error = QApplication::translate("::Core", "The command for file browser is not set.");
+ error = Tr::tr("The command for file browser is not set.");
} else {
QProcess browserProc;
browserProc.setProgram(browserArgs.takeFirst());
@@ -86,7 +86,7 @@ void FileUtils::showInGraphicalShell(QWidget *parent, const FilePath &pathIn)
const bool success = browserProc.startDetached();
error = QString::fromLocal8Bit(browserProc.readAllStandardError());
if (!success && error.isEmpty())
- error = QApplication::translate("::Core", "Error while starting file browser.");
+ error = Tr::tr("Error while starting file browser.");
}
if (!error.isEmpty())
showGraphicalShellError(parent, app, error);
diff --git a/src/plugins/coreplugin/locator/locatorsettingspage.cpp b/src/plugins/coreplugin/locator/locatorsettingspage.cpp
index f85948dc5e..9940680aa2 100644
--- a/src/plugins/coreplugin/locator/locatorsettingspage.cpp
+++ b/src/plugins/coreplugin/locator/locatorsettingspage.cpp
@@ -20,7 +20,6 @@
#include <utils/qtcassert.h>
#include <utils/treemodel.h>
-#include <QCoreApplication>
#include <QHash>
#include <QHeaderView>
#include <QLabel>
@@ -430,7 +429,7 @@ void LocatorSettingsWidget::removeCustomFilter()
LocatorSettingsPage::LocatorSettingsPage()
{
setId(Constants::FILTER_OPTIONS_PAGE);
- setDisplayName(QCoreApplication::translate("::Core", Constants::FILTER_OPTIONS_PAGE));
+ setDisplayName(Tr::tr(Constants::FILTER_OPTIONS_PAGE));
setCategory(Constants::SETTINGS_CATEGORY_CORE);
setWidgetCreator([] { return new LocatorSettingsWidget; });
}
diff --git a/src/plugins/cppcheck/cppcheckoptions.cpp b/src/plugins/cppcheck/cppcheckoptions.cpp
index 217a8e9063..11563430cc 100644
--- a/src/plugins/cppcheck/cppcheckoptions.cpp
+++ b/src/plugins/cppcheck/cppcheckoptions.cpp
@@ -18,6 +18,7 @@
#include <coreplugin/icore.h>
#include <debugger/analyzer/analyzericons.h>
+#include <debugger/debuggertr.h>
#include <QCheckBox>
#include <QFormLayout>
@@ -126,7 +127,7 @@ CppcheckOptionsPage::CppcheckOptionsPage(CppcheckTool &tool, CppcheckTrigger &tr
setId(Constants::OPTIONS_PAGE_ID);
setDisplayName(Tr::tr("Cppcheck"));
setCategory("T.Analyzer");
- setDisplayCategory(QCoreApplication::translate("::Debugger", "Analyzer"));
+ setDisplayCategory(::Debugger::Tr::tr("Analyzer"));
setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);
CppcheckOptions options;
diff --git a/src/plugins/cppeditor/cppcurrentdocumentfilter.cpp b/src/plugins/cppeditor/cppcurrentdocumentfilter.cpp
index 6c7c444806..0285fd71fd 100644
--- a/src/plugins/cppeditor/cppcurrentdocumentfilter.cpp
+++ b/src/plugins/cppeditor/cppcurrentdocumentfilter.cpp
@@ -4,6 +4,7 @@
#include "cppcurrentdocumentfilter.h"
#include "cppeditorconstants.h"
+#include "cppeditortr.h"
#include "cppmodelmanager.h"
#include <coreplugin/editormanager/editormanager.h>
@@ -20,8 +21,7 @@ CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppModelManager *manager)
: m_modelManager(manager)
{
setId(Constants::CURRENT_DOCUMENT_FILTER_ID);
- setDisplayName(QCoreApplication::translate("::CppEditor",
- Constants::CURRENT_DOCUMENT_FILTER_DISPLAY_NAME));
+ setDisplayName(Tr::tr(Constants::CURRENT_DOCUMENT_FILTER_DISPLAY_NAME));
setDefaultShortcutString(".");
setPriority(High);
setDefaultIncludedByDefault(false);
diff --git a/src/plugins/debugger/console/console.cpp b/src/plugins/debugger/console/console.cpp
index 72fecca154..b1c3767f0e 100644
--- a/src/plugins/debugger/console/console.cpp
+++ b/src/plugins/debugger/console/console.cpp
@@ -18,7 +18,6 @@
#include <coreplugin/find/itemviewfind.h>
#include <QAction>
-#include <QCoreApplication>
#include <QToolButton>
#include <QLabel>
#include <QVBoxLayout>
@@ -256,8 +255,7 @@ void Console::evaluate(const QString &expression)
m_scriptEvaluator(expression);
} else {
auto item = new ConsoleItem(
- ConsoleItem::ErrorType,
- QCoreApplication::translate("::Debugger", "Can only evaluate during a debug session."));
+ ConsoleItem::ErrorType, Tr::tr("Can only evaluate during a debug session."));
m_consoleItemModel->shiftEditableRow();
printItem(item);
}
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 8180395d40..cec06c16b0 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1063,19 +1063,19 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
debugMenu->addSeparator();
act = new QAction(this);
- act->setText(QCoreApplication::translate("::Debugger", "Move to Calling Frame"));
+ act->setText(Tr::tr("Move to Calling Frame"));
act->setEnabled(false);
act->setVisible(false);
ActionManager::registerAction(act, Constants::FRAME_UP);
act = new QAction(this);
- act->setText(QCoreApplication::translate("::Debugger", "Move to Called Frame"));
+ act->setText(Tr::tr("Move to Called Frame"));
act->setEnabled(false);
act->setVisible(false);
ActionManager::registerAction(act, Constants::FRAME_DOWN);
act = new QAction(this);
- act->setText(QCoreApplication::translate("::Debugger", "Operate by Instruction"));
+ act->setText(Tr::tr("Operate by Instruction"));
act->setEnabled(false);
act->setVisible(false);
act->setCheckable(true);
diff --git a/src/plugins/designer/formeditorplugin.cpp b/src/plugins/designer/formeditorplugin.cpp
index 50a5f4a8df..8d26f27f0f 100644
--- a/src/plugins/designer/formeditorplugin.cpp
+++ b/src/plugins/designer/formeditorplugin.cpp
@@ -18,6 +18,7 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h>
+#include <coreplugin/coreplugintr.h>
#include <coreplugin/designmode.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
@@ -65,8 +66,7 @@ void FormEditorPlugin::initialize()
IWizardFactory::registerFactoryCreator([]() -> IWizardFactory * {
IWizardFactory *wizard = new FormClassWizard;
wizard->setCategory(Core::Constants::WIZARD_CATEGORY_QT);
- wizard->setDisplayCategory(
- QCoreApplication::translate("::Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
+ wizard->setDisplayCategory(::Core::Tr::tr(Core::Constants::WIZARD_TR_CATEGORY_QT));
wizard->setDisplayName(Tr::tr("Qt Designer Form Class"));
wizard->setIcon({}, "ui/h");
wizard->setId("C.FormClass");
diff --git a/src/plugins/designer/formtemplatewizardpage.cpp b/src/plugins/designer/formtemplatewizardpage.cpp
index a77b5b4321..c6417522f4 100644
--- a/src/plugins/designer/formtemplatewizardpage.cpp
+++ b/src/plugins/designer/formtemplatewizardpage.cpp
@@ -6,11 +6,11 @@
#include "formtemplatewizardpage.h"
#include <projectexplorer/jsonwizard/jsonwizardpagefactory.h>
+#include <projectexplorer/projectexplorertr.h>
#include <utils/qtcassert.h>
#include <utils/wizard.h>
-#include <QCoreApplication>
#include <QDesignerNewFormWidgetInterface>
#include <QDebug>
#include <QXmlStreamReader>
@@ -46,8 +46,8 @@ bool FormPageFactory::validateData(Utils::Id typeId, const QVariant &data, QStri
{
QTC_ASSERT(canCreate(typeId), return false);
if (!data.isNull() && (data.type() != QVariant::Map || !data.toMap().isEmpty())) {
- *errorMessage = QCoreApplication::translate("::ProjectExplorer",
- "\"data\" for a \"Form\" page needs to be unset or an empty object.");
+ *errorMessage = ::ProjectExplorer::Tr::tr(
+ "\"data\" for a \"Form\" page needs to be unset or an empty object.");
return false;
}
diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp
index 5c11a0e7dc..2a955f131f 100644
--- a/src/plugins/docker/dockerdevice.cpp
+++ b/src/plugins/docker/dockerdevice.cpp
@@ -20,6 +20,7 @@
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/project.h>
+#include <projectexplorer/projectexplorertr.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/toolchainmanager.h>
@@ -976,7 +977,7 @@ public:
m_log->setVisible(dockerDeviceLog().isDebugEnabled());
const QString fail = QString{"Docker: "}
- + QCoreApplication::translate("::Debugger", "Process failed to start.");
+ + ::ProjectExplorer::Tr::tr("The process failed to start.");
auto errorLabel = new Utils::InfoLabel(fail, Utils::InfoLabel::Error, this);
errorLabel->setVisible(false);
diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp
index d0b822ecfe..571964d0b3 100644
--- a/src/plugins/help/helpwidget.cpp
+++ b/src/plugins/help/helpwidget.cpp
@@ -20,19 +20,19 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h>
-#include <coreplugin/icore.h>
+#include <coreplugin/coreplugintr.h>
#include <coreplugin/findplaceholder.h>
+#include <coreplugin/icore.h>
#include <coreplugin/locator/locatormanager.h>
#include <coreplugin/minisplitter.h>
-#include <coreplugin/sidebar.h>
#include <coreplugin/minisplitter.h>
+#include <coreplugin/sidebar.h>
#include <texteditor/texteditorconstants.h>
#include <utils/qtcassert.h>
#include <utils/styledbar.h>
#include <utils/utilsicons.h>
#include <QComboBox>
-#include <QCoreApplication>
#include <QHBoxLayout>
#include <QLabel>
#include <QMenu>
@@ -223,18 +223,15 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
if (style != SideBarWidget) {
m_toggleSideBarAction
= new QAction(Utils::Icons::TOGGLE_LEFT_SIDEBAR_TOOLBAR.icon(),
- QCoreApplication::translate("::Core",
- Core::Constants::TR_SHOW_LEFT_SIDEBAR),
- toolBar);
+ Tr::tr(Core::Constants::TR_SHOW_LEFT_SIDEBAR), toolBar);
m_toggleSideBarAction->setCheckable(true);
m_toggleSideBarAction->setChecked(false);
cmd = Core::ActionManager::registerAction(m_toggleSideBarAction,
Core::Constants::TOGGLE_LEFT_SIDEBAR, context);
connect(m_toggleSideBarAction, &QAction::toggled, m_toggleSideBarAction, [this](bool checked) {
- m_toggleSideBarAction->setText(
- QCoreApplication::translate("::Core",
- checked ? Core::Constants::TR_HIDE_LEFT_SIDEBAR
- : Core::Constants::TR_SHOW_LEFT_SIDEBAR));
+ m_toggleSideBarAction->setText(::Core::Tr::tr(
+ checked ? Core::Constants::TR_HIDE_LEFT_SIDEBAR
+ : Core::Constants::TR_SHOW_LEFT_SIDEBAR));
});
addSideBar();
m_toggleSideBarAction->setChecked(m_sideBar->isVisibleTo(this));
diff --git a/src/plugins/languageclient/languageclientoutline.cpp b/src/plugins/languageclient/languageclientoutline.cpp
index 9ab057de62..0d7ae8c371 100644
--- a/src/plugins/languageclient/languageclientoutline.cpp
+++ b/src/plugins/languageclient/languageclientoutline.cpp
@@ -13,6 +13,7 @@
#include <texteditor/outlinefactory.h>
#include <texteditor/textdocument.h>
#include <texteditor/texteditor.h>
+#include <texteditor/texteditortr.h>
#include <utils/dropsupport.h>
#include <utils/itemviews.h>
#include <utils/navigationtreeview.h>
@@ -388,8 +389,7 @@ OutlineComboBox::OutlineComboBox(Client *client, TextEditor::BaseTextEditor *edi
setMaxVisibleItems(40);
setContextMenuPolicy(Qt::ActionsContextMenu);
- const QString sortActionText
- = QCoreApplication::translate("::TextEditor", "Sort Alphabetically");
+ const QString sortActionText = ::TextEditor::Tr::tr("Sort Alphabetically");
auto sortAction = new QAction(sortActionText, this);
sortAction->setCheckable(true);
sortAction->setChecked(sorted);
diff --git a/src/plugins/perfprofiler/perfoptionspage.cpp b/src/plugins/perfprofiler/perfoptionspage.cpp
index c67d18d63f..e295a5be48 100644
--- a/src/plugins/perfprofiler/perfoptionspage.cpp
+++ b/src/plugins/perfprofiler/perfoptionspage.cpp
@@ -7,6 +7,7 @@
#include "perfprofilertr.h"
#include <debugger/analyzer/analyzericons.h>
+#include <debugger/debuggertr.h>
namespace PerfProfiler {
namespace Internal {
@@ -16,7 +17,7 @@ PerfOptionsPage::PerfOptionsPage(PerfSettings *settings)
setId(Constants::PerfSettingsId);
setDisplayName(Tr::tr("CPU Usage"));
setCategory("T.Analyzer");
- setDisplayCategory(QCoreApplication::translate("::Debugger", "Analyzer"));
+ setDisplayCategory(::Debugger::Tr::tr("Analyzer"));
setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);
setWidgetCreator([settings] { return new PerfConfigWidget(settings); });
}
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 0cfd8a8926..622b18b31e 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -90,6 +90,7 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h>
+#include <coreplugin/coreplugintr.h>
#include <coreplugin/diffservice.h>
#include <coreplugin/documentmanager.h>
#include <coreplugin/editormanager/documentmodel.h>
@@ -3358,8 +3359,7 @@ void ProjectExplorerPluginPrivate::updateRecentProjectMenu()
// add the Clear Menu item
if (hasRecentProjects) {
menu->addSeparator();
- QAction *action = menu->addAction(QCoreApplication::translate(
- "::Core", Core::Constants::TR_CLEAR_MENU));
+ QAction *action = menu->addAction(::Core::Tr::tr(Core::Constants::TR_CLEAR_MENU));
connect(action, &QAction::triggered,
this, &ProjectExplorerPluginPrivate::clearRecentProjects);
}
diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp
index 6adcefd342..afe2b45e7e 100644
--- a/src/plugins/projectexplorer/projectwindow.cpp
+++ b/src/plugins/projectexplorer/projectwindow.cpp
@@ -22,6 +22,7 @@
#include <coreplugin/actionmanager/commandbutton.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreicons.h>
+#include <coreplugin/coreplugintr.h>
#include <coreplugin/find/optionspopup.h>
#include <coreplugin/findplaceholder.h>
#include <coreplugin/icontext.h>
@@ -619,10 +620,8 @@ public:
m_toggleRightSidebarAction.setCheckable(true);
m_toggleRightSidebarAction.setChecked(true);
const auto toolTipText = [](bool checked) {
- return checked ? QCoreApplication::translate("::Core",
- Core::Constants::TR_HIDE_RIGHT_SIDEBAR)
- : QCoreApplication::translate("::Core",
- Core::Constants::TR_SHOW_RIGHT_SIDEBAR);
+ return checked ? ::Core::Tr::tr(Core::Constants::TR_HIDE_RIGHT_SIDEBAR)
+ : ::Core::Tr::tr(Core::Constants::TR_SHOW_RIGHT_SIDEBAR);
};
m_toggleRightSidebarAction.setText(toolTipText(false)); // always "Show Right Sidebar"
m_toggleRightSidebarAction.setToolTip(toolTipText(m_toggleRightSidebarAction.isChecked()));
diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp
index 71930d5ea1..7b1fdbe092 100644
--- a/src/plugins/qmldesigner/qmldesignerplugin.cpp
+++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "qmldesignerplugin.h"
+#include "qmldesignertr.h"
#include "coreplugin/iwizardfactory.h"
#include "designmodecontext.h"
#include "designmodewidget.h"
@@ -63,7 +64,6 @@
#include <QAction>
#include <QApplication>
-#include <QCoreApplication>
#include <QDebug>
#include <QProcessEnvironment>
#include <QScreen>
@@ -254,8 +254,7 @@ bool QmlDesignerPlugin::initialize(const QStringList & /*arguments*/, QString *e
.toBool());
Exception::setShowExceptionCallback([&](QStringView title, QStringView description) {
- QString composedTitle = title.isEmpty() ? QCoreApplication::translate("::QmlDesigner", "Error")
- : title.toString();
+ const QString composedTitle = title.isEmpty() ? Tr::tr("Error") : title.toString();
Core::AsynchronousMessageBox::warning(composedTitle, description.toString());
});
diff --git a/src/plugins/qmlprofiler/qmlprofilersettings.cpp b/src/plugins/qmlprofiler/qmlprofilersettings.cpp
index 62fba256d8..481a88ab32 100644
--- a/src/plugins/qmlprofiler/qmlprofilersettings.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilersettings.cpp
@@ -9,6 +9,7 @@
#include <coreplugin/icore.h>
#include <debugger/analyzer/analyzericons.h>
+#include <debugger/debuggertr.h>
#include <utils/layoutbuilder.h>
@@ -82,7 +83,7 @@ QmlProfilerOptionsPage::QmlProfilerOptionsPage()
setId(Constants::SETTINGS);
setDisplayName(Tr::tr("QML Profiler"));
setCategory("T.Analyzer");
- setDisplayCategory(Tr::tr("Analyzer"));
+ setDisplayCategory(::Debugger::Tr::tr("Analyzer"));
setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);
}
diff --git a/src/plugins/qtsupport/codegensettingspage.cpp b/src/plugins/qtsupport/codegensettingspage.cpp
index 7291487c49..8e0a3cfca0 100644
--- a/src/plugins/qtsupport/codegensettingspage.cpp
+++ b/src/plugins/qtsupport/codegensettingspage.cpp
@@ -10,6 +10,7 @@
#include <coreplugin/icore.h>
#include <cppeditor/cppeditorconstants.h>
+#include <cppeditor/cppeditortr.h>
#include <utils/layoutbuilder.h>
@@ -117,8 +118,7 @@ CodeGenSettingsPage::CodeGenSettingsPage()
setId(Constants::CODEGEN_SETTINGS_PAGE_ID);
setDisplayName(Tr::tr("Qt Class Generation"));
setCategory(CppEditor::Constants::CPP_SETTINGS_CATEGORY);
- setDisplayCategory(
- QCoreApplication::translate("::CppEditor", CppEditor::Constants::CPP_SETTINGS_NAME));
+ setDisplayCategory(::CppEditor::Tr::tr(CppEditor::Constants::CPP_SETTINGS_NAME));
setCategoryIconPath(":/projectexplorer/images/settingscategory_cpp.png");
setWidgetCreator([] { return new CodeGenSettingsPageWidget; });
}
diff --git a/src/plugins/texteditor/snippets/snippetscollection.cpp b/src/plugins/texteditor/snippets/snippetscollection.cpp
index c9b148360b..be658c1477 100644
--- a/src/plugins/texteditor/snippets/snippetscollection.cpp
+++ b/src/plugins/texteditor/snippets/snippetscollection.cpp
@@ -356,7 +356,7 @@ QList<Snippet> SnippetsCollection::readXML(const FilePath &fileName, const QStri
} else if (isGroupKnown(groupId) && (snippetId.isEmpty() || snippetId == id)) {
Snippet snippet(groupId, id);
snippet.setTrigger(trigger);
- snippet.setComplement(QCoreApplication::translate("::TextEditor",
+ snippet.setComplement(Tr::tr(
atts.value(kComplement).toString().toLatin1(),
atts.value(kId).toString().toLatin1()));
snippet.setIsRemoved(toBool(atts.value(kRemoved).toString()));
diff --git a/src/plugins/valgrind/valgrindconfigwidget.cpp b/src/plugins/valgrind/valgrindconfigwidget.cpp
index ebcda20fdd..d8999c9e69 100644
--- a/src/plugins/valgrind/valgrindconfigwidget.cpp
+++ b/src/plugins/valgrind/valgrindconfigwidget.cpp
@@ -6,6 +6,7 @@
#include "valgrindtr.h"
#include <debugger/analyzer/analyzericons.h>
+#include <debugger/debuggertr.h>
#include <coreplugin/icore.h>
@@ -90,7 +91,7 @@ ValgrindOptionsPage::ValgrindOptionsPage()
setId(ANALYZER_VALGRIND_SETTINGS);
setDisplayName(Tr::tr("Valgrind"));
setCategory("T.Analyzer");
- setDisplayCategory(Tr::tr("Analyzer"));
+ setDisplayCategory(::Debugger::Tr::tr("Analyzer"));
setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);
setWidgetCreator([] { return new ValgrindConfigWidget(ValgrindGlobalSettings::instance()); });
}
diff --git a/src/plugins/vcsbase/basevcseditorfactory.cpp b/src/plugins/vcsbase/basevcseditorfactory.cpp
index 463202f87b..cbcfd2f86f 100644
--- a/src/plugins/vcsbase/basevcseditorfactory.cpp
+++ b/src/plugins/vcsbase/basevcseditorfactory.cpp
@@ -2,7 +2,9 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "basevcseditorfactory.h"
+
#include "vcsbaseeditor.h"
+#include "vcsbasetr.h"
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/textdocument.h>
@@ -11,7 +13,6 @@
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
-#include <QCoreApplication>
#include <QStringList>
using namespace TextEditor;
@@ -33,7 +34,7 @@ VcsEditorFactory::VcsEditorFactory(const VcsBaseEditorParameters *parameters,
std::function<void (const Utils::FilePath &, const QString &)> describeFunc)
{
setId(parameters->id);
- setDisplayName(QCoreApplication::translate("::VcsBase", parameters->displayName));
+ setDisplayName(Tr::tr(parameters->displayName));
if (QLatin1String(parameters->mimeType) != QLatin1String(DiffEditor::Constants::DIFF_EDITOR_MIMETYPE))
addMimeType(QLatin1String(parameters->mimeType));
diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
index 282609c0f7..00c46fbce1 100644
--- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
+++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
@@ -151,7 +151,7 @@ void VcsBaseSubmitEditor::setParameters(const VcsBaseSubmitEditorParameters &par
d->m_file.setMimeType(QLatin1String(parameters.mimeType));
setWidget(d->m_widget);
- document()->setPreferredDisplayName(QCoreApplication::translate("::VcsBase", d->m_parameters.displayName));
+ document()->setPreferredDisplayName(Tr::tr(d->m_parameters.displayName));
// Message font according to settings
CompletingTextEdit *descriptionEdit = d->m_widget->descriptionEdit();