LanguageClient: Tr::tr

Change-Id: Idbd7c5cdadba4f269b2033df91db0e05bb5281d5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-01-19 18:16:35 +01:00
parent 6780a6ca50
commit 77054c2fa3
20 changed files with 95 additions and 250 deletions

View File

@@ -41865,7 +41865,7 @@ Was soll %1 tun?</translation>
</message>
</context>
<context>
<name>LanguageClient::ResponseError</name>
<name>::LanguageClient</name>
<message>
<source>Error %1</source>
<translation>Fehler %1</translation>
@@ -41919,9 +41919,6 @@ Was soll %1 tun?</translation>
<source>Functions and Methods in Workspace</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::LanguageClientManager</name>
<message>
<source>Unexpectedly finished. Restarting in %1 seconds.</source>
<translation>Unerwartet beendet. Neustart in %1 Sekunden.</translation>
@@ -41934,9 +41931,6 @@ Was soll %1 tun?</translation>
<source>Show available quick fixes</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::BaseSettingsWidget</name>
<message>
<source>Name:</source>
<translation>Name:</translation>
@@ -41969,9 +41963,6 @@ Was soll %1 tun?</translation>
<source>Language server-specific JSON to pass via &quot;initializationOptions&quot; field of &quot;initialize&quot; request.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::StdIOSettingsWidget</name>
<message>
<source>Executable:</source>
<translation>Ausführbare Datei:</translation>
@@ -42175,7 +42166,7 @@ Was soll %1 tun?</translation>
</message>
</context>
<context>
<name>LanguageClientSettingsPage</name>
<name>::LanguageClient</name>
<message>
<source>&amp;Add</source>
<translation>Hinzu&amp;fügen</translation>
@@ -42188,9 +42179,6 @@ Was soll %1 tun?</translation>
<source>General</source>
<translation>Allgemein</translation>
</message>
</context>
<context>
<name>MimeTypeDialog</name>
<message>
<source>Select MIME Types</source>
<translation>MIME-Typen auswählen</translation>
@@ -43066,7 +43054,7 @@ You might find further explanations in the Application Output view.</source>
</message>
</context>
<context>
<name>LanguageClient::Client</name>
<name>::LanguageClient</name>
<message>
<source>%1 for %2</source>
<translation type="unfinished"></translation>
@@ -43095,9 +43083,6 @@ You might find further explanations in the Application Output view.</source>
<source>error</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::StdIOClientInterface</name>
<message>
<source>Cannot send data to unstarted server %1</source>
<translation>Kann keine Daten an den nicht gestarteten Server %1 schicken</translation>
@@ -46675,7 +46660,7 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
</message>
</context>
<context>
<name>SymbolSupport</name>
<name>::LanguageClient</name>
<message>
<source>Find References with %1 for:</source>
<translation>Referenzen mit %1 finden für:</translation>
@@ -52921,7 +52906,7 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.</translation>
</message>
</context>
<context>
<name>LanguageClient::ClientPrivate</name>
<name>::LanguageClient</name>
<message>
<source>Invalid parameter in &quot;%1&quot;:
%2</source>
@@ -52947,23 +52932,14 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.</translation>
<source>No initialize result.</source>
<translation type="unfinished">Initialisierung ohne Ergebnis.</translation>
</message>
</context>
<context>
<name>LanguageClient::DiagnosticManager</name>
<message>
<source>Copy to Clipboard</source>
<translation type="unfinished">In die Zwischenablage kopieren</translation>
</message>
</context>
<context>
<name>LanguageClient::BaseClientInterface</name>
<message>
<source>Cannot handle MIME type of message %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::LanguageClientPlugin</name>
<message>
<source>Generic StdIO Language Server</source>
<translation type="unfinished"></translation>
@@ -52972,9 +52948,6 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.</translation>
<source>Inspect Language Clients...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::BaseSettings</name>
<message>
<source>Always On</source>
<translation type="unfinished"></translation>
@@ -52987,9 +52960,6 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.</translation>
<source>Start Server per Project</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::ReplaceWidget</name>
<message>
<source>Search Again to update results and re-enable Replace</source>
<translation type="unfinished"></translation>
@@ -53007,16 +52977,10 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.</translation>
<translation type="unfinished">Dateien:
%1</translation>
</message>
</context>
<context>
<name>LanguageClient::DocumentLocatorFilter</name>
<message>
<source>Matches all symbols from the current document, based on a language server.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::LspInspector</name>
<message>
<source>Expand All</source>
<translation type="unfinished"></translation>
@@ -53037,9 +53001,6 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.</translation>
<source>Log File</source>
<translation type="unfinished">Logdatei</translation>
</message>
</context>
<context>
<name>LspCapabilitiesWidget</name>
<message>
<source>Capabilities:</source>
<translation type="unfinished">Fähigkeiten:</translation>
@@ -53060,9 +53021,6 @@ Hinweis: Dies macht Sie anfällig für Man-in-the-middle-Angriffe.</translation>
<source>Server Capabilities</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LspInspectorWidget</name>
<message>
<source>Language Client Inspector</source>
<translation type="unfinished"></translation>

View File

@@ -10851,7 +10851,7 @@ will also disable the following plugins:
</message>
</context>
<context>
<name>LanguageClient::ResponseError</name>
<name>::LanguageClient</name>
<message>
<source>Error %1</source>
<translation>Greška %1</translation>
@@ -25161,7 +25161,7 @@ Rok upotrebe: %3</translation>
</message>
</context>
<context>
<name>LanguageClient::Client</name>
<name>::LanguageClient</name>
<message>
<source>Cannot handle content of type: %1</source>
<translation>Nije moguće rukovati sadržajem vrste: %1</translation>
@@ -25186,16 +25186,10 @@ Rok upotrebe: %3</translation>
<source>Initialize result is not valid: </source>
<translation>Rezultat za inicijaliziranje nije ispravan: </translation>
</message>
</context>
<context>
<name>::LanguageClient</name>
<message>
<source>Language Client</source>
<translation>Klijent za jezike</translation>
</message>
</context>
<context>
<name>LanguageClient::StdIOClientInterface</name>
<message>
<source>Cannot send data to unstarted server %1</source>
<translation type="unfinished"></translation>
@@ -25204,9 +25198,6 @@ Rok upotrebe: %3</translation>
<source>Crashed with exit code %1: %2</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::LanguageClientManager</name>
<message>
<source>Unexpectedly finished. Restarting in %1 seconds.</source>
<translation type="unfinished"></translation>
@@ -25219,9 +25210,6 @@ Rok upotrebe: %3</translation>
<source>Find References with %1 for:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClientSettingsPage</name>
<message>
<source>&amp;Add</source>
<translation>Dod&amp;aj</translation>
@@ -25234,9 +25222,6 @@ Rok upotrebe: %3</translation>
<source>General</source>
<translation>Opće</translation>
</message>
</context>
<context>
<name>LanguageClient::BaseSettingsWidget</name>
<message>
<source>Name</source>
<translation>Naziv</translation>
@@ -25273,9 +25258,6 @@ Rok upotrebe: %3</translation>
<source>Capabilities:</source>
<translation>Sposobnosti:</translation>
</message>
</context>
<context>
<name>MimeTypeDialog</name>
<message>
<source>Select MIME Types</source>
<translation>Odaberi MIME vrste</translation>
@@ -25284,9 +25266,6 @@ Rok upotrebe: %3</translation>
<source>Filter</source>
<translation>Filtar</translation>
</message>
</context>
<context>
<name>LanguageClient::StdIOSettingsWidget</name>
<message>
<source>Executable:</source>
<translation>Izvršna datoteka:</translation>

View File

@@ -43737,7 +43737,7 @@ Output:
</message>
</context>
<context>
<name>LanguageClient::ResponseError</name>
<name>::LanguageClient</name>
<message>
<source>Error %1</source>
<translation>: %1</translation>
@@ -46089,21 +46089,15 @@ Stepping into the module or setting breakpoints by file and line is expected to
<name>::Ios</name>
</context>
<context>
<name>LanguageClient::DiagnosticManager</name>
<name>::LanguageClient</name>
<message>
<source>Copy to Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::LanguageClientPlugin</name>
<message>
<source>Generic StdIO Language Server</source>
<translation> StdIO </translation>
</message>
</context>
<context>
<name>LanguageClientSettingsPage</name>
<message>
<source>&amp;Add</source>
<translation>(&amp;A)</translation>
@@ -46116,9 +46110,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>General</source>
<translation></translation>
</message>
</context>
<context>
<name>LanguageClient::BaseSettingsWidget</name>
<message>
<source>Name</source>
<translation type="vanished"></translation>
@@ -46135,16 +46126,10 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>Language:</source>
<translation>:</translation>
</message>
</context>
<context>
<name>MimeTypeDialog</name>
<message>
<source>Filter</source>
<translation></translation>
</message>
</context>
<context>
<name>LanguageClient::StdIOSettingsWidget</name>
<message>
<source>Executable:</source>
<translation>:</translation>
@@ -46153,9 +46138,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>Arguments:</source>
<translation>:</translation>
</message>
</context>
<context>
<name>LanguageClient::LspInspector</name>
<message>
<source>Expand All</source>
<translation></translation>
@@ -46176,9 +46158,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>Log File</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LspCapabilitiesWidget</name>
<message>
<source>Capabilities:</source>
<translation>:</translation>
@@ -46199,9 +46178,6 @@ Stepping into the module or setting breakpoints by file and line is expected to
<source>Server Capabilities</source>
<translation> </translation>
</message>
</context>
<context>
<name>LspInspectorWidget</name>
<message>
<source>Language Client Inspector</source>
<translation></translation>

View File

@@ -22519,7 +22519,7 @@ Add, modify, and remove document filters, which determine the documentation set
</message>
</context>
<context>
<name>HoverHandler</name>
<name>::LanguageClient</name>
<message>
<source>Got unsupported markup hover content: </source>
<translation>Получен неподдерживаемый форматированный текст под курсором: </translation>
@@ -23822,9 +23822,6 @@ Error: %5</translation>
<source>Functions and Methods in Workspace</source>
<translation>Функции и методы сессии</translation>
</message>
</context>
<context>
<name>LanguageClient::BaseSettings</name>
<message>
<source>Always On</source>
<translation>Всегда включено</translation>
@@ -23837,9 +23834,6 @@ Error: %5</translation>
<source>Start Server per Project</source>
<translation>Запускать сервер на каждый проект</translation>
</message>
</context>
<context>
<name>LanguageClient::BaseSettingsWidget</name>
<message>
<source>Name</source>
<translation>Имя</translation>
@@ -23892,9 +23886,6 @@ Error: %5</translation>
<source>Language server-specific JSON to pass via &quot;initializationOptions&quot; field of &quot;initialize&quot; request.</source>
<translation>Специфичный для языкового сервера JSON, передаваемый в поле «initializationOptions» запроса «initialize».</translation>
</message>
</context>
<context>
<name>LanguageClient::Client</name>
<message>
<source>Cannot handle content of type: %1</source>
<translation>Нельзя обработать содержимое типа %1</translation>
@@ -23919,9 +23910,6 @@ Error: %5</translation>
<source>Initialize result is not valid: </source>
<translation>Результат инициализации неверен: </translation>
</message>
</context>
<context>
<name>LanguageClient::LanguageClientManager</name>
<message>
<source>Unexpectedly finished. Restarting in %1 seconds.</source>
<translation>Неожиданное завершение. Перезапуск через %1 секунд.</translation>
@@ -23930,16 +23918,10 @@ Error: %5</translation>
<source>Unexpectedly finished.</source>
<translation>Неожиданное завершение.</translation>
</message>
</context>
<context>
<name>LanguageClient::ResponseError</name>
<message>
<source>Error %1</source>
<translation>Ошибка %1</translation>
</message>
</context>
<context>
<name>LanguageClient::StdIOClientInterface</name>
<message>
<source>Cannot send data to unstarted server %1</source>
<translation>Нельзя отправить данные на незапущенный сервер %1</translation>
@@ -23948,9 +23930,6 @@ Error: %5</translation>
<source>Crashed with exit code %1: %2</source>
<translation>Аварийно завершился с кодом %1: %2</translation>
</message>
</context>
<context>
<name>LanguageClient::StdIOSettingsWidget</name>
<message>
<source>Executable:</source>
<translation>Программа:</translation>
@@ -23959,9 +23938,6 @@ Error: %5</translation>
<source>Arguments:</source>
<translation>Параметры:</translation>
</message>
</context>
<context>
<name>LanguageClientSettingsPage</name>
<message>
<source>&amp;Add</source>
<translation>&amp;Добавить</translation>
@@ -25461,7 +25437,7 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
</message>
</context>
<context>
<name>MimeTypeDialog</name>
<name>::LanguageClient</name>
<message>
<source>Select MIME Types</source>
<translation>Выбрать MIME-типы</translation>
@@ -43066,7 +43042,7 @@ Row: %4, Column: %5
</message>
</context>
<context>
<name>SymbolSupport</name>
<name>::LanguageClient</name>
<message>
<source>Find References with %1 for:</source>
<translation>Найти ссылки с %1 для:</translation>

View File

@@ -23654,16 +23654,10 @@ Error: %5</source>
<source>Functions and Methods in Workspace</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::BaseClientInterface</name>
<message>
<source>Cannot handle MIME type of message %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::BaseSettings</name>
<message>
<source>Always On</source>
<translation type="unfinished"></translation>
@@ -23676,9 +23670,6 @@ Error: %5</source>
<source>Start Server per Project</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::BaseSettingsWidget</name>
<message>
<source>Name:</source>
<translation type="unfinished">:</translation>
@@ -23711,9 +23702,6 @@ Error: %5</source>
<source>Language server-specific JSON to pass via &quot;initializationOptions&quot; field of &quot;initialize&quot; request.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::Client</name>
<message>
<source>%1 for %2</source>
<translation type="unfinished"></translation>
@@ -23742,9 +23730,6 @@ Error: %5</source>
<source>error</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::ClientPrivate</name>
<message>
<source>Invalid parameter in &quot;%1&quot;:
%2</source>
@@ -23770,23 +23755,14 @@ Error: %5</source>
<source>No initialize result.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::DiagnosticManager</name>
<message>
<source>Copy to Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::DocumentLocatorFilter</name>
<message>
<source>Matches all symbols from the current document, based on a language server.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::LanguageClientManager</name>
<message>
<source>Unexpectedly finished. Restarting in %1 seconds.</source>
<translation type="unfinished"></translation>
@@ -23799,9 +23775,6 @@ Error: %5</source>
<source>Show available quick fixes</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::LanguageClientPlugin</name>
<message>
<source>Generic StdIO Language Server</source>
<translation type="unfinished"></translation>
@@ -23810,9 +23783,6 @@ Error: %5</source>
<source>Inspect Language Clients...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::LspInspector</name>
<message>
<source>Expand All</source>
<translation type="unfinished"></translation>
@@ -23833,9 +23803,6 @@ Error: %5</source>
<source>Log File</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::ReplaceWidget</name>
<message>
<source>Search Again to update results and re-enable Replace</source>
<translation type="unfinished"></translation>
@@ -23851,23 +23818,14 @@ Error: %5</source>
%1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::ResponseError</name>
<message>
<source>Error %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::StdIOClientInterface</name>
<message>
<source>Cannot send data to unstarted server %1</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageClient::StdIOSettingsWidget</name>
<message>
<source>Executable:</source>
<translation type="unfinished">:</translation>
@@ -23876,9 +23834,6 @@ Error: %5</source>
<source>Arguments:</source>
<translation type="unfinished">:</translation>
</message>
</context>
<context>
<name>LanguageClientSettingsPage</name>
<message>
<source>&amp;Add</source>
<translation type="unfinished">(&amp;A)</translation>
@@ -24024,7 +23979,7 @@ Error: %5</source>
</message>
</context>
<context>
<name>LspCapabilitiesWidget</name>
<name>::LanguageClient</name>
<message>
<source>Capabilities:</source>
<translation type="unfinished">:</translation>
@@ -24045,9 +24000,6 @@ Error: %5</source>
<source>Server Capabilities</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LspInspectorWidget</name>
<message>
<source>Language Client Inspector</source>
<translation type="unfinished"></translation>
@@ -25094,7 +25046,7 @@ Useful if build directory is corrupted or when rebuilding with a newer version o
</message>
</context>
<context>
<name>MimeTypeDialog</name>
<name>::LanguageClient</name>
<message>
<source>Select MIME Types</source>
<translation type="unfinished"></translation>
@@ -42096,7 +42048,7 @@ Failed to open file &quot;%1&quot;</source>
</message>
</context>
<context>
<name>SymbolSupport</name>
<name>::LanguageClient</name>
<message>
<source>Find References with %1 for:</source>
<translation type="unfinished"></translation>

View File

@@ -271,7 +271,7 @@ void CallHierarchy::handlePrepareResponse(Client *client,
CallHierarchyFactory::CallHierarchyFactory()
{
setDisplayName(tr("Call Hierarchy"));
setDisplayName(Tr::tr("Call Hierarchy"));
setPriority(650);
setId(CALL_HIERARCHY_FACTORY_ID);
}

View File

@@ -14,6 +14,7 @@
#include "languageclientquickfix.h"
#include "languageclientsymbolsupport.h"
#include "languageclientutils.h"
#include "languageclienttr.h"
#include "progressmanager.h"
#include "semantichighlightsupport.h"
@@ -350,7 +351,7 @@ void Client::setName(const QString &name)
QString Client::name() const
{
if (d->m_project && !d->m_project->displayName().isEmpty())
return tr("%1 for %2").arg(d->m_displayName, d->m_project->displayName());
return Tr::tr("%1 for %2").arg(d->m_displayName, d->m_project->displayName());
return d->m_displayName;
}
@@ -547,12 +548,12 @@ Client::State Client::state() const
QString Client::stateString() const
{
switch (d->m_state){
case Uninitialized: return tr("uninitialized");
case InitializeRequested: return tr("initialize requested");
case Initialized: return tr("initialized");
case ShutdownRequested: return tr("shutdown requested");
case Shutdown: return tr("shutdown");
case Error: return tr("error");
case Uninitialized: return Tr::tr("uninitialized");
case InitializeRequested: return Tr::tr("initialize requested");
case Initialized: return Tr::tr("initialized");
case ShutdownRequested: return Tr::tr("shutdown requested");
case Shutdown: return Tr::tr("shutdown");
case Error: return Tr::tr("error");
}
return {};
}
@@ -1754,7 +1755,7 @@ static ResponseError<T> createInvalidParamsError(const QString &message)
void ClientPrivate::handleMethod(const QString &method, const MessageId &id, const JsonRpcMessage &message)
{
auto invalidParamsErrorMessage = [&](const JsonObject &params) {
return tr("Invalid parameter in \"%1\":\n%2")
return Tr::tr("Invalid parameter in \"%1\":\n%2")
.arg(method, QString::fromUtf8(QJsonDocument(params).toJson(QJsonDocument::Indented)));
};
@@ -1946,7 +1947,7 @@ void ClientPrivate::initializeCallback(const InitializeRequest::Response &initRe
if (std::optional<ResponseError<InitializeError>> error = initResponse.error()) {
if (std::optional<InitializeError> data = error->data()) {
if (data->retry()) {
const QString title(tr("Language Server \"%1\" Initialize Error").arg(m_displayName));
const QString title(Tr::tr("Language Server \"%1\" Initialize Error").arg(m_displayName));
auto result = QMessageBox::warning(Core::ICore::dialogParent(),
title,
error->message(),
@@ -1959,20 +1960,20 @@ void ClientPrivate::initializeCallback(const InitializeRequest::Response &initRe
}
}
}
q->setError(tr("Initialize error: ") + error->message());
q->setError(Tr::tr("Initialize error: ") + error->message());
emit q->finished();
return;
}
if (const std::optional<InitializeResult> &result = initResponse.result()) {
if (!result->isValid()) { // continue on ill formed result
q->log(QJsonDocument(*result).toJson(QJsonDocument::Indented) + '\n'
+ tr("Initialize result is invalid."));
+ Tr::tr("Initialize result is invalid."));
}
const std::optional<ServerInfo> serverInfo = result->serverInfo();
if (serverInfo) {
if (!serverInfo->isValid()) {
q->log(QJsonDocument(*result).toJson(QJsonDocument::Indented) + '\n'
+ tr("Server Info is invalid."));
+ Tr::tr("Server Info is invalid."));
} else {
m_serverName = serverInfo->name();
if (const std::optional<QString> version = serverInfo->version())
@@ -1982,7 +1983,7 @@ void ClientPrivate::initializeCallback(const InitializeRequest::Response &initRe
m_serverCapabilities = result->capabilities();
} else {
q->log(tr("No initialize result."));
q->log(Tr::tr("No initialize result."));
}
if (auto completionProvider = qobject_cast<LanguageClientCompletionAssistProvider *>(

View File

@@ -4,6 +4,7 @@
#include "diagnosticmanager.h"
#include "client.h"
#include "languageclienttr.h"
#include <coreplugin/editormanager/documentmodel.h>
@@ -122,7 +123,7 @@ TextEditor::TextMark *DiagnosticManager::createTextMark(const FilePath &filePath
bool /*isProjectFile*/) const
{
static const auto icon = QIcon::fromTheme("edit-copy", Utils::Icons::COPY.icon());
static const QString tooltip = tr("Copy to Clipboard");
static const QString tooltip = Tr::tr("Copy to Clipboard");
auto mark = new TextMark(filePath, diagnostic, m_client);
mark->setActionsProvider([text = diagnostic.message()] {
QAction *action = new QAction();

View File

@@ -19,7 +19,6 @@ using HelpItemProvider = std::function<void(const LanguageServerProtocol::HoverR
class LANGUAGECLIENT_EXPORT HoverHandler final : public TextEditor::BaseHoverHandler
{
Q_DECLARE_TR_FUNCTIONS(HoverHandler)
public:
explicit HoverHandler(Client *client);
~HoverHandler() override;

View File

@@ -3,6 +3,8 @@
#include "languageclientinterface.h"
#include "languageclienttr.h"
#include <QLoggingCategory>
using namespace LanguageServerProtocol;
@@ -69,7 +71,7 @@ void BaseClientInterface::parseCurrentMessage()
if (m_currentMessage.mimeType == JsonRpcMessage::jsonRpcMimeType()) {
emit messageReceived(JsonRpcMessage(m_currentMessage));
} else {
emit error(tr("Cannot handle MIME type of message %1")
emit error(Tr::tr("Cannot handle MIME type of message %1")
.arg(QString::fromUtf8(m_currentMessage.mimeType)));
}
m_currentMessage = BaseMessage();
@@ -93,7 +95,7 @@ void StdIOClientInterface::startImpl()
QTC_CHECK(!m_process->isRunning());
delete m_process;
}
m_process = new Utils::QtcProcess;
m_process = new QtcProcess;
m_process->setProcessMode(ProcessMode::Writer);
connect(m_process, &QtcProcess::readyReadStandardError,
this, &StdIOClientInterface::readError);
@@ -126,12 +128,12 @@ void StdIOClientInterface::setWorkingDirectory(const FilePath &workingDirectory)
m_workingDirectory = workingDirectory;
}
void StdIOClientInterface::setEnvironment(const Utils::Environment &environment)
void StdIOClientInterface::setEnvironment(const Environment &environment)
{
m_env = environment;
}
Utils::FilePath StdIOClientInterface::serverDeviceTemplate() const
FilePath StdIOClientInterface::serverDeviceTemplate() const
{
return m_cmd.executable();
}
@@ -139,7 +141,7 @@ Utils::FilePath StdIOClientInterface::serverDeviceTemplate() const
void StdIOClientInterface::sendData(const QByteArray &data)
{
if (!m_process || m_process->state() != QProcess::Running) {
emit error(tr("Cannot send data to unstarted server %1")
emit error(Tr::tr("Cannot send data to unstarted server %1")
.arg(m_cmd.toUserOutput()));
return;
}

View File

@@ -5,19 +5,24 @@
#include "languageclientplugin.h"
#include "languageclientsymbolsupport.h"
#include "languageclienttr.h"
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/find/searchresultwindow.h>
#include <coreplugin/icore.h>
#include <languageserverprotocol/messages.h>
#include <languageserverprotocol/progresssupport.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <texteditor/textdocument.h>
#include <texteditor/texteditor.h>
#include <texteditor/textmark.h>
#include <utils/algorithm.h>
#include <utils/executeondestruction.h>
#include <utils/theme/theme.h>
@@ -155,7 +160,7 @@ void LanguageClientManager::clientFinished(Client *client)
if (client->reset()) {
qCDebug(Log) << "restart unexpectedly finished client: " << client->name() << client;
client->log(
tr("Unexpectedly finished. Restarting in %1 seconds.").arg(restartTimeoutS));
Tr::tr("Unexpectedly finished. Restarting in %1 seconds.").arg(restartTimeoutS));
QTimer::singleShot(restartTimeoutS * 1000, client, [client]() { client->start(); });
for (TextEditor::TextDocument *document : clientDocs) {
client->deactivateDocument(document);
@@ -165,7 +170,7 @@ void LanguageClientManager::clientFinished(Client *client)
return;
}
qCDebug(Log) << "client finished unexpectedly: " << client->name() << client;
client->log(tr("Unexpectedly finished."));
client->log(Tr::tr("Unexpectedly finished."));
for (TextEditor::TextDocument *document : clientDocs)
managerInstance->m_clientForDocument.remove(document);
}

View File

@@ -346,7 +346,6 @@ TextEditor::IOutlineWidget *LanguageClientOutlineWidgetFactory::createWidget(Cor
class OutlineComboBox : public Utils::TreeViewComboBox
{
Q_DECLARE_TR_FUNCTIONS(LanguageClient::OutlineComboBox)
public:
OutlineComboBox(Client *client, TextEditor::BaseTextEditor *editor);
@@ -390,8 +389,7 @@ OutlineComboBox::OutlineComboBox(Client *client, TextEditor::BaseTextEditor *edi
setContextMenuPolicy(Qt::ActionsContextMenu);
const QString sortActionText
= QCoreApplication::translate("TextEditor::Internal::OutlineWidgetStack",
"Sort Alphabetically");
= QCoreApplication::translate("::TextEditor", "Sort Alphabetically");
auto sortAction = new QAction(sortActionText, this);
sortAction->setCheckable(true);
sortAction->setChecked(sorted);

View File

@@ -5,6 +5,7 @@
#include "client.h"
#include "languageclientmanager.h"
#include "languageclienttr.h"
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/actionmanager.h>
@@ -38,14 +39,14 @@ bool LanguageClientPlugin::initialize(const QStringList & /*arguments*/, QString
LanguageClientManager::init();
LanguageClientSettings::registerClientType({Constants::LANGUAGECLIENT_STDIO_SETTINGS_ID,
tr("Generic StdIO Language Server"),
Tr::tr("Generic StdIO Language Server"),
[]() { return new StdIOSettings; }});
//register actions
ActionContainer *toolsDebugContainer = ActionManager::actionContainer(
Core::Constants::M_TOOLS_DEBUG);
auto inspectAction = new QAction(tr("Inspect Language Clients..."), this);
auto inspectAction = new QAction(Tr::tr("Inspect Language Clients..."), this);
connect(inspectAction, &QAction::triggered, this, &LanguageClientManager::showInspector);
toolsDebugContainer->addAction(
ActionManager::registerAction(inspectAction, "LanguageClient.InspectLanguageClients"));

View File

@@ -127,7 +127,6 @@ private:
class LanguageClientSettingsPage : public Core::IOptionsPage
{
Q_DECLARE_TR_FUNCTIONS(LanguageClientSettingsPage)
public:
LanguageClientSettingsPage();
~LanguageClientSettingsPage() override;
@@ -173,7 +172,7 @@ LanguageClientSettingsPageWidget::LanguageClientSettingsPageWidget(LanguageClien
connect(m_view->selectionModel(), &QItemSelectionModel::currentChanged,
this, &LanguageClientSettingsPageWidget::currentChanged);
auto buttonLayout = new QVBoxLayout();
auto addButton = new QPushButton(LanguageClientSettingsPage::tr("&Add"));
auto addButton = new QPushButton(Tr::tr("&Add"));
auto addMenu = new QMenu;
addMenu->clear();
for (const ClientType &type : clientTypes()) {
@@ -182,7 +181,7 @@ LanguageClientSettingsPageWidget::LanguageClientSettingsPageWidget(LanguageClien
addMenu->addAction(action);
}
addButton->setMenu(addMenu);
auto deleteButton = new QPushButton(LanguageClientSettingsPage::tr("&Delete"));
auto deleteButton = new QPushButton(Tr::tr("&Delete"));
connect(deleteButton, &QPushButton::pressed, this, &LanguageClientSettingsPageWidget::deleteItem);
mainLayout->addLayout(layout);
setLayout(mainLayout);
@@ -268,7 +267,7 @@ void LanguageClientSettingsPageWidget::deleteItem()
LanguageClientSettingsPage::LanguageClientSettingsPage()
{
setId(Constants::LANGUAGECLIENT_SETTINGS_PAGE);
setDisplayName(tr("General"));
setDisplayName(Tr::tr("General"));
setCategory(Constants::LANGUAGECLIENT_SETTINGS_CATEGORY);
setDisplayCategory(Tr::tr(Constants::LANGUAGECLIENT_SETTINGS_TR));
setCategoryIconPath(":/languageclient/images/settingscategory_languageclient.png");
@@ -791,12 +790,11 @@ static QString startupBehaviorString(BaseSettings::StartBehavior behavior)
{
switch (behavior) {
case BaseSettings::AlwaysOn:
return QCoreApplication::translate("LanguageClient::BaseSettings", "Always On");
return Tr::tr("Always On");
case BaseSettings::RequiresFile:
return QCoreApplication::translate("LanguageClient::BaseSettings", "Requires an Open File");
return Tr::tr("Requires an Open File");
case BaseSettings::RequiresProject:
return QCoreApplication::translate("LanguageClient::BaseSettings",
"Start Server per Project");
return Tr::tr("Start Server per Project");
default:
break;
}
@@ -814,24 +812,24 @@ BaseSettingsWidget::BaseSettingsWidget(const BaseSettings *settings, QWidget *pa
int row = 0;
auto *mainLayout = new QGridLayout;
mainLayout->addWidget(new QLabel(tr("Name:")), row, 0);
mainLayout->addWidget(new QLabel(Tr::tr("Name:")), row, 0);
mainLayout->addWidget(m_name, row, 1);
auto chooser = new Utils::VariableChooser(this);
chooser->addSupportedWidget(m_name);
mainLayout->addWidget(new QLabel(tr("Language:")), ++row, 0);
mainLayout->addWidget(new QLabel(Tr::tr("Language:")), ++row, 0);
auto mimeLayout = new QHBoxLayout;
mimeLayout->addWidget(m_mimeTypes);
mimeLayout->addStretch();
auto addMimeTypeButton = new QPushButton(tr("Set MIME Types..."), this);
auto addMimeTypeButton = new QPushButton(Tr::tr("Set MIME Types..."), this);
mimeLayout->addWidget(addMimeTypeButton);
mainLayout->addLayout(mimeLayout, row, 1);
m_filePattern->setPlaceholderText(tr("File pattern"));
m_filePattern->setPlaceholderText(Tr::tr("File pattern"));
m_filePattern->setToolTip(
Tr::tr("List of file patterns.\nExample: *.cpp%1*.h").arg(filterSeparator));
mainLayout->addWidget(m_filePattern, ++row, 1);
mainLayout->addWidget(new QLabel(tr("Startup behavior:")), ++row, 0);
mainLayout->addWidget(new QLabel(Tr::tr("Startup behavior:")), ++row, 0);
for (int behavior = 0; behavior < BaseSettings::LastSentinel ; ++behavior)
m_startupBehavior->addItem(startupBehaviorString(BaseSettings::StartBehavior(behavior)));
m_startupBehavior->setCurrentIndex(settings->m_startBehavior);
@@ -841,7 +839,7 @@ BaseSettingsWidget::BaseSettingsWidget(const BaseSettings *settings, QWidget *pa
connect(addMimeTypeButton, &QPushButton::pressed,
this, &BaseSettingsWidget::showAddMimeTypeDialog);
mainLayout->addWidget(new QLabel(tr("Initialization options:")), ++row, 0);
mainLayout->addWidget(new QLabel(Tr::tr("Initialization options:")), ++row, 0);
mainLayout->addWidget(m_initializationOptions, row, 1);
chooser->addSupportedWidget(m_initializationOptions);
m_initializationOptions->setValidationFunction([](Utils::FancyLineEdit *edit, QString *errorMessage) {
@@ -855,7 +853,7 @@ BaseSettingsWidget::BaseSettingsWidget(const BaseSettings *settings, QWidget *pa
if (json.isNull()) {
if (errorMessage)
*errorMessage = tr("Failed to parse JSON at %1: %2")
*errorMessage = Tr::tr("Failed to parse JSON at %1: %2")
.arg(parseInfo.offset)
.arg(parseInfo.errorString());
return false;
@@ -863,7 +861,7 @@ BaseSettingsWidget::BaseSettingsWidget(const BaseSettings *settings, QWidget *pa
return true;
});
m_initializationOptions->setText(settings->m_initializationOptions);
m_initializationOptions->setPlaceholderText(tr("Language server-specific JSON to pass via "
m_initializationOptions->setPlaceholderText(Tr::tr("Language server-specific JSON to pass via "
"\"initializationOptions\" field of \"initialize\" "
"request."));
@@ -929,12 +927,11 @@ public:
class MimeTypeDialog : public QDialog
{
Q_DECLARE_TR_FUNCTIONS(MimeTypeDialog)
public:
explicit MimeTypeDialog(const QStringList &selectedMimeTypes, QWidget *parent = nullptr)
: QDialog(parent)
{
setWindowTitle(tr("Select MIME Types"));
setWindowTitle(Tr::tr("Select MIME Types"));
auto mainLayout = new QVBoxLayout;
auto filter = new Utils::FancyLineEdit(this);
filter->setFiltering(true);
@@ -945,7 +942,7 @@ public:
mainLayout->addWidget(buttons);
setLayout(mainLayout);
filter->setPlaceholderText(tr("Filter"));
filter->setPlaceholderText(Tr::tr("Filter"));
connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
auto proxy = new QSortFilterProxyModel(this);
@@ -992,9 +989,9 @@ StdIOSettingsWidget::StdIOSettingsWidget(const StdIOSettings *settings, QWidget
auto mainLayout = qobject_cast<QGridLayout *>(layout());
QTC_ASSERT(mainLayout, return);
const int baseRows = mainLayout->rowCount();
mainLayout->addWidget(new QLabel(tr("Executable:")), baseRows, 0);
mainLayout->addWidget(new QLabel(Tr::tr("Executable:")), baseRows, 0);
mainLayout->addWidget(m_executable, baseRows, 1);
mainLayout->addWidget(new QLabel(tr("Arguments:")), baseRows + 1, 0);
mainLayout->addWidget(new QLabel(Tr::tr("Arguments:")), baseRows + 1, 0);
m_executable->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_executable->setFilePath(settings->m_executable);
mainLayout->addWidget(m_arguments, baseRows + 1, 1);

View File

@@ -131,7 +131,6 @@ struct ClientType {
class LANGUAGECLIENT_EXPORT LanguageClientSettings
{
Q_DECLARE_TR_FUNCTIONS(LanguageClientSettings)
public:
static void init();
static QList<BaseSettings *> fromSettings(QSettings *settings);

View File

@@ -6,6 +6,7 @@
#include "client.h"
#include "dynamiccapabilities.h"
#include "languageclientutils.h"
#include "languageclienttr.h"
#include <coreplugin/documentmanager.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -33,7 +34,7 @@ class ReplaceWidget : public QWidget
public:
ReplaceWidget()
{
m_infoLabel.setText(tr("Search Again to update results and re-enable Replace"));
m_infoLabel.setText(Tr::tr("Search Again to update results and re-enable Replace"));
m_infoLabel.setVisible(false);
m_renameFilesCheckBox.setVisible(false);
const auto layout = new QHBoxLayout(this);
@@ -54,12 +55,12 @@ public:
m_renameFilesCheckBox.hide();
return;
}
m_renameFilesCheckBox.setText(tr("Re&name %n files", nullptr, filesToRename.size()));
m_renameFilesCheckBox.setText(Tr::tr("Re&name %n files", nullptr, filesToRename.size()));
const auto filesForUser = Utils::transform<QStringList>(filesToRename,
[](const Utils::FilePath &fp) {
return fp.toUserOutput();
});
m_renameFilesCheckBox.setToolTip(tr("Files:\n%1").arg(filesForUser.join('\n')));
m_renameFilesCheckBox.setToolTip(Tr::tr("Files:\n%1").arg(filesForUser.join('\n')));
m_renameFilesCheckBox.setVisible(true);
}
@@ -287,7 +288,7 @@ void SymbolSupport::handleFindReferencesResponse(const FindReferencesRequest::Re
}
if (result) {
Core::SearchResult *search = Core::SearchResultWindow::instance()->startNewSearch(
tr("Find References with %1 for:").arg(m_client->name()), "", wordUnderCursor);
Tr::tr("Find References with %1 for:").arg(m_client->name()), "", wordUnderCursor);
search->addResults(generateSearchResultItems(*result, m_client->hostPathMapper()),
Core::SearchResult::AddOrdered);
connect(search, &Core::SearchResult::activated, [](const Core::SearchResultItem &item) {
@@ -373,7 +374,7 @@ void SymbolSupport::renameSymbol(TextEditor::TextDocument *document,
bool prepareSupported;
if (!LanguageClient::supportsRename(m_client, document, prepareSupported)) {
const QString error = tr("Renaming is not supported with %1").arg(m_client->name());
const QString error = Tr::tr("Renaming is not supported with %1").arg(m_client->name());
createSearch(params, derivePlaceholder(oldSymbolName, newSymbolName),
{}, {})->finishSearch(true, error);
} else if (prepareSupported) {
@@ -482,7 +483,7 @@ Core::SearchResult *SymbolSupport::createSearch(const TextDocumentPositionParams
bool preferLowerCaseFileNames)
{
Core::SearchResult *search = Core::SearchResultWindow::instance()->startNewSearch(
tr("Find References with %1 for:").arg(m_client->name()),
Tr::tr("Find References with %1 for:").arg(m_client->name()),
"",
placeholder,
Core::SearchResultWindow::SearchAndReplace);
@@ -504,7 +505,7 @@ Core::SearchResult *SymbolSupport::createSearch(const TextDocumentPositionParams
auto resetConnection
= connect(this, &QObject::destroyed, search, [search, clientName = m_client->name()]() {
search->restart(); // clears potential current results
search->finishSearch(true, tr("%1 is not reachable anymore.").arg(clientName));
search->finishSearch(true, Tr::tr("%1 is not reachable anymore.").arg(clientName));
});
connect(search, &Core::SearchResult::replaceButtonClicked, this,

View File

@@ -25,7 +25,6 @@ class Client;
class LANGUAGECLIENT_EXPORT SymbolSupport : public QObject
{
Q_DECLARE_TR_FUNCTIONS(SymbolSupport)
public:
explicit SymbolSupport(Client *client);

View File

@@ -150,7 +150,7 @@ void updateCodeActionRefactoringMarker(Client *client,
const QTextCursor cursor = endOfLineCursor(range.start().toTextCursor(doc->document()));
const auto it = markersAtBlock.find(cursor.blockNumber());
if (it != markersAtBlock.end()) {
it->tooltip = LanguageClientManager::tr("Show available quick fixes");
it->tooltip = Tr::tr("Show available quick fixes");
it->callback = [cursor](TextEditorWidget *editor) {
editor->setTextCursor(cursor);
editor->invokeAssist(TextEditor::QuickFix);

View File

@@ -32,7 +32,7 @@ DocumentLocatorFilter::DocumentLocatorFilter()
setId(Constants::LANGUAGECLIENT_DOCUMENT_FILTER_ID);
setDisplayName(Tr::tr(Constants::LANGUAGECLIENT_DOCUMENT_FILTER_DISPLAY_NAME));
setDescription(
tr("Matches all symbols from the current document, based on a language server."));
Tr::tr("Matches all symbols from the current document, based on a language server."));
setDefaultShortcutString(".");
setDefaultIncludedByDefault(false);
setPriority(ILocatorFilter::Low);

View File

@@ -5,11 +5,14 @@
#include "client.h"
#include "languageclientmanager.h"
#include "languageclienttr.h"
#include <coreplugin/icore.h>
#include <coreplugin/minisplitter.h>
#include <languageserverprotocol/jsonkeys.h>
#include <languageserverprotocol/jsonrpcmessages.h>
#include <utils/jsontreeitem.h>
#include <utils/listmodel.h>
@@ -75,7 +78,7 @@ QTreeView *createJsonTreeView()
{
auto view = new QTreeView;
view->setContextMenuPolicy(Qt::ActionsContextMenu);
auto action = new QAction(LspInspector::tr("Expand All"), view);
auto action = new QAction(Tr::tr("Expand All"), view);
QObject::connect(action, &QAction::triggered, view, &QTreeView::expandAll);
view->addAction(action);
view->setAlternatingRowColors(true);
@@ -105,7 +108,6 @@ private:
class LspCapabilitiesWidget : public QWidget
{
Q_DECLARE_TR_FUNCTIONS(LspCapabilitiesWidget)
public:
LspCapabilitiesWidget();
void setCapabilities(const Capabilities &serverCapabilities);
@@ -124,20 +126,20 @@ LspCapabilitiesWidget::LspCapabilitiesWidget()
{
auto mainLayout = new QHBoxLayout;
auto group = new QGroupBox(tr("Capabilities:"));
auto group = new QGroupBox(Tr::tr("Capabilities:"));
QLayout *layout = new QHBoxLayout;
m_capabilitiesView = createJsonTreeView();
layout->addWidget(m_capabilitiesView);
group->setLayout(layout);
mainLayout->addWidget(group);
m_dynamicCapabilitiesGroup = new QGroupBox(tr("Dynamic Capabilities:"));
m_dynamicCapabilitiesGroup = new QGroupBox(Tr::tr("Dynamic Capabilities:"));
layout = new QVBoxLayout;
auto label = new QLabel(tr("Method:"));
auto label = new QLabel(Tr::tr("Method:"));
layout->addWidget(label);
m_dynamicCapabilitiesView = new QListWidget();
layout->addWidget(m_dynamicCapabilitiesView);
label = new QLabel(tr("Options:"));
label = new QLabel(Tr::tr("Options:"));
layout->addWidget(label);
m_dynamicOptionsView = createJsonTreeView();
layout->addWidget(m_dynamicOptionsView);
@@ -155,7 +157,7 @@ LspCapabilitiesWidget::LspCapabilitiesWidget()
void LspCapabilitiesWidget::setCapabilities(const Capabilities &serverCapabilities)
{
m_capabilitiesView->setModel(
createJsonModel(tr("Server Capabilities"), QJsonObject(serverCapabilities.capabilities)));
createJsonModel(Tr::tr("Server Capabilities"), QJsonObject(serverCapabilities.capabilities)));
m_dynamicCapabilities = serverCapabilities.dynamicCapabilities;
const QStringList &methods = m_dynamicCapabilities.registeredMethods();
if (methods.isEmpty()) {
@@ -208,7 +210,7 @@ LspLogWidget::LspLogWidget()
m_clientDetails = new MessageDetailWidget;
m_clientDetails->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_clientDetails->setTitle(LspInspector::tr("Client Message"));
m_clientDetails->setTitle(Tr::tr("Client Message"));
addWidget(m_clientDetails);
setStretchFactor(0, 1);
@@ -216,7 +218,7 @@ LspLogWidget::LspLogWidget()
m_messages = new QListView;
m_messages->setModel(&m_model);
m_messages->setAlternatingRowColors(true);
m_model.setHeader({LspInspector::tr("Messages")});
m_model.setHeader({Tr::tr("Messages")});
m_messages->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
m_messages->setSelectionMode(QAbstractItemView::MultiSelection);
addWidget(m_messages);
@@ -224,7 +226,7 @@ LspLogWidget::LspLogWidget()
m_serverDetails = new MessageDetailWidget;
m_serverDetails->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_serverDetails->setTitle(LspInspector::tr("Server Message"));
m_serverDetails->setTitle(Tr::tr("Server Message"));
addWidget(m_serverDetails);
setStretchFactor(2, 1);
@@ -306,7 +308,7 @@ void LspLogWidget::saveLog()
stream << "\n\n";
});
const FilePath filePath = FileUtils::getSaveFilePath(this, LspInspector::tr("Log File"));
const FilePath filePath = FileUtils::getSaveFilePath(this, Tr::tr("Log File"));
if (filePath.isEmpty())
return;
FileSaver saver(filePath, QIODevice::Text);
@@ -317,7 +319,6 @@ void LspLogWidget::saveLog()
class LspInspectorWidget : public QDialog
{
Q_DECLARE_TR_FUNCTIONS(LspInspectorWidget)
public:
explicit LspInspectorWidget(LspInspector *inspector);
@@ -393,7 +394,7 @@ QList<QString> LspInspector::clients() const
LspInspectorWidget::LspInspectorWidget(LspInspector *inspector)
: m_inspector(inspector), m_tabWidget(new QTabWidget(this))
{
setWindowTitle(tr("Language Client Inspector"));
setWindowTitle(Tr::tr("Language Client Inspector"));
connect(inspector, &LspInspector::newMessage, this, &LspInspectorWidget::addMessage);
connect(inspector, &LspInspector::capabilitiesUpdated,
@@ -411,13 +412,13 @@ LspInspectorWidget::LspInspectorWidget(LspInspector *inspector)
mainSplitter->addWidget(m_tabWidget);
mainSplitter->setStretchFactor(0, 0);
mainSplitter->setStretchFactor(1, 1);
m_tabWidget->addTab(new LspLogWidget, tr("Log"));
m_tabWidget->addTab(new LspCapabilitiesWidget, tr("Capabilities"));
m_tabWidget->addTab(new LspLogWidget, Tr::tr("Log"));
m_tabWidget->addTab(new LspCapabilitiesWidget, Tr::tr("Capabilities"));
mainLayout->addWidget(mainSplitter);
auto buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Close);
const auto clearButton = buttonBox->addButton(tr("Clear"), QDialogButtonBox::ResetRole);
const auto clearButton = buttonBox->addButton(Tr::tr("Clear"), QDialogButtonBox::ResetRole);
connect(clearButton, &QPushButton::clicked, this, [this] {
m_inspector->clear();
if (m_clients->currentItem())