Translations: Use QCoreApplication::translate() instead of tr()

QCoreApplication::translate() takes a context parameter, tr() does not.
We want the first one.

Amends: 48affa1889

Change-Id: Ibca327a39097dfcdb81a30e561161d3275c61d1d
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Alessandro Portale
2023-02-08 20:40:58 +01:00
parent 86a14c8b27
commit 98b1fcb7b3
8 changed files with 14 additions and 14 deletions

View File

@@ -162,8 +162,8 @@ public:
if (auto parameter = params()) if (auto parameter = params())
return parameter->isValid(); return parameter->isValid();
if (errorMessage) if (errorMessage)
*errorMessage = QCoreApplication::tr("::LanguageServerProtocol", *errorMessage = QCoreApplication::translate("::LanguageServerProtocol",
"No parameters in \"%1\".").arg(method()); "No parameters in \"%1\".").arg(method());
return false; return false;
} }
}; };
@@ -375,8 +375,8 @@ public:
if (id().isValid()) if (id().isValid())
return true; return true;
if (errorMessage) if (errorMessage)
*errorMessage = QCoreApplication::tr("::LanguageServerProtocol", *errorMessage = QCoreApplication::translate("::LanguageServerProtocol",
"No ID set in \"%1\".").arg(this->method()); "No ID set in \"%1\".").arg(this->method());
return false; return false;
} }

View File

@@ -25,7 +25,7 @@ public:
TestRunConfiguration(ProjectExplorer::Target *parent, TestConfiguration *config) TestRunConfiguration(ProjectExplorer::Target *parent, TestConfiguration *config)
: ProjectExplorer::RunConfiguration(parent, "AutoTest.TestRunConfig") : ProjectExplorer::RunConfiguration(parent, "AutoTest.TestRunConfig")
{ {
setDefaultDisplayName(QCoreApplication::tr("::Autotest", "AutoTest Debug")); setDefaultDisplayName(QCoreApplication::translate("::Autotest", "AutoTest Debug"));
bool enableQuick = false; bool enableQuick = false;
if (auto debuggable = dynamic_cast<DebuggableTestConfiguration *>(config)) if (auto debuggable = dynamic_cast<DebuggableTestConfiguration *>(config))

View File

@@ -46,8 +46,8 @@ private:
void toggleThreadRestriction(QAction *action); void toggleThreadRestriction(QAction *action);
Utils::Perspective m_perspective{Constants::CtfVisualizerPerspectiveId, Utils::Perspective m_perspective{Constants::CtfVisualizerPerspectiveId,
QCoreApplication::tr("::CtfVisualizer", QCoreApplication::translate("::CtfVisualizer",
"Chrome Trace Format Visualizer")}; "Chrome Trace Format Visualizer")};
bool m_isLoading; bool m_isLoading;
QScopedPointer<QAction> m_loadJson; QScopedPointer<QAction> m_loadJson;

View File

@@ -14,8 +14,8 @@ class MesonActionsManager : public QObject
{ {
Q_OBJECT Q_OBJECT
Utils::ParameterAction buildTargetContextAction{ Utils::ParameterAction buildTargetContextAction{
QCoreApplication::tr("::MesonProjectManager", "Build"), QCoreApplication::translate("::MesonProjectManager", "Build"),
QCoreApplication::tr("::MesonProjectManager", "Build \"%1\""), QCoreApplication::translate("::MesonProjectManager", "Build \"%1\""),
Utils::ParameterAction::AlwaysEnabled /*handled manually*/ Utils::ParameterAction::AlwaysEnabled /*handled manually*/
}; };
QAction configureActionMenu; QAction configureActionMenu;

View File

@@ -83,8 +83,8 @@ private:
void finalize(); void finalize();
Utils::Perspective m_perspective{Constants::PerfProfilerPerspectiveId, Utils::Perspective m_perspective{Constants::PerfProfilerPerspectiveId,
QCoreApplication::tr("::PerfProfiler", QCoreApplication::translate("::PerfProfiler",
"Performance Analyzer")}; "Performance Analyzer")};
QAction *m_startAction = nullptr; QAction *m_startAction = nullptr;
QAction *m_stopAction = nullptr; QAction *m_stopAction = nullptr;

View File

@@ -37,7 +37,7 @@ public:
QWidget *outputWidget(QWidget *) override; QWidget *outputWidget(QWidget *) override;
QList<QWidget *> toolBarWidgets() const override; QList<QWidget *> toolBarWidgets() const override;
QString displayName() const override { QString displayName() const override {
return QCoreApplication::tr("::ProjectExplorer","Compile Output"); } return QCoreApplication::translate("::ProjectExplorer","Compile Output"); }
int priorityInStatusBar() const override; int priorityInStatusBar() const override;
void clearContents() override; void clearContents() override;
bool canFocus() const override; bool canFocus() const override;

View File

@@ -43,7 +43,7 @@ class ProjectWelcomePage : public Core::IWelcomePage
public: public:
ProjectWelcomePage(); ProjectWelcomePage();
QString title() const override { return QCoreApplication::tr("::ProjectExplorer", "Projects"); } QString title() const override { return QCoreApplication::translate("::ProjectExplorer", "Projects"); }
int priority() const override { return 20; } int priority() const override { return 20; }
Utils::Id id() const override; Utils::Id id() const override;
QWidget *createWidget() const override; QWidget *createWidget() const override;

View File

@@ -40,7 +40,7 @@ public:
QString title() const override QString title() const override
{ {
return QCoreApplication::tr("::ScxmlEditor", "Search"); return QCoreApplication::translate("::ScxmlEditor", "Search");
} }
QIcon icon() const override QIcon icon() const override