summaryrefslogtreecommitdiff
path: root/src/plugins/python/pythonlanguageclient.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-07-15 11:49:34 +0200
committerhjk <hjk@qt.io>2022-07-21 08:25:04 +0000
commit26dd8aef2ac160956c39ac2aca0f6f5c21cbc65e (patch)
tree21f5211a1f32fe0d10a172f34a76bb8730b4dd1c /src/plugins/python/pythonlanguageclient.cpp
parentf3bceeda532fcc70211ee2397d1925add638ffb4 (diff)
downloadqt-creator-26dd8aef2ac160956c39ac2aca0f6f5c21cbc65e.tar.gz
Python: Convert to Tr::tr
Change-Id: I0241053b0d51dbb1a60c43351cbff543fd52573d Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/python/pythonlanguageclient.cpp')
-rw-r--r--src/plugins/python/pythonlanguageclient.cpp19
1 files changed, 11 insertions, 8 deletions
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 <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/progressmanager/progressmanager.h>
+
#include <languageclient/languageclientinterface.h>
#include <languageclient/languageclientmanager.h>
#include <languageserverprotocol/textsynchronization.h>
#include <languageserverprotocol/workspace.h>
+
#include <projectexplorer/extracompiler.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
+
#include <texteditor/textdocument.h>
#include <texteditor/texteditor.h>
+
#include <utils/infobar.h>
#include <utils/qtcprocess.h>
#include <utils/runextensions.h>
@@ -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