From 26dd8aef2ac160956c39ac2aca0f6f5c21cbc65e Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 15 Jul 2022 11:49:34 +0200 Subject: Python: Convert to Tr::tr Change-Id: I0241053b0d51dbb1a60c43351cbff543fd52573d Reviewed-by: Eike Ziller Reviewed-by: --- src/plugins/python/pythonlanguageclient.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/plugins/python/pythonlanguageclient.cpp') diff --git a/src/plugins/python/pythonlanguageclient.cpp b/src/plugins/python/pythonlanguageclient.cpp index e621cd6283..d5566543e2 100644 --- a/src/plugins/python/pythonlanguageclient.cpp +++ b/src/plugins/python/pythonlanguageclient.cpp @@ -32,20 +32,25 @@ #include "pythonproject.h" #include "pythonrunconfiguration.h" #include "pythonsettings.h" +#include "pythontr.h" #include "pythonutils.h" #include #include #include + #include #include #include #include + #include #include #include + #include #include + #include #include #include @@ -66,8 +71,7 @@ using namespace LanguageServerProtocol; using namespace ProjectExplorer; using namespace Utils; -namespace Python { -namespace Internal { +namespace Python::Internal { static constexpr char installPylsInfoBarId[] = "Python::InstallPyls"; @@ -178,7 +182,7 @@ PyLSClient *clientForPython(const FilePath &python) auto interface = new PyLSInterface; interface->setCommandLine(CommandLine(python, {"-m", "pylsp"})); auto client = new PyLSClient(interface); - client->setName(PyLSClient::tr("Python Language Server (%1)").arg(python.toUserOutput())); + client->setName(Tr::tr("Python Language Server (%1)").arg(python.toUserOutput())); client->setActivateDocumentAutomatically(true); client->updateConfiguration(); LanguageFilter filter; @@ -374,13 +378,13 @@ void PyLSConfigureAssistant::handlePyLSState(const FilePath &python, Utils::InfoBar *infoBar = document->infoBar(); if (state.state == PythonLanguageServerState::CanBeInstalled && infoBar->canInfoBeAdded(installPylsInfoBarId)) { - auto message = tr("Install Python language server (PyLS) for %1 (%2). " - "The language server provides Python specific completion and annotation.") + auto message = Tr::tr("Install Python language server (PyLS) for %1 (%2). " + "The language server provides Python specific completion and annotation.") .arg(pythonName(python), python.toUserOutput()); Utils::InfoBarEntry info(installPylsInfoBarId, message, Utils::InfoBarEntry::GlobalSuppression::Enabled); - info.addCustomButton(tr("Install"), + info.addCustomButton(Tr::tr("Install"), [=]() { installPythonLanguageServer(python, document); }); infoBar->addInfo(info); m_infoBarEntries[python] << document; @@ -420,5 +424,4 @@ PyLSConfigureAssistant::PyLSConfigureAssistant(QObject *parent) }); } -} // namespace Internal -} // namespace Python +} // Python::Internal -- cgit v1.2.1