LanguageServerProtocol: Tr::tr

Change-Id: Ica2f568385545552b255fcf05694e8ecde92407f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2023-01-23 20:23:22 +01:00
parent ad1ae7bd48
commit 1129079108
10 changed files with 30 additions and 79 deletions

View File

@@ -41996,7 +41996,7 @@ Was soll %1 tun?</translation>
</message>
</context>
<context>
<name>BaseMessage</name>
<name>LanguageServerProtocol</name>
<message>
<source>Cannot decode content with &quot;%1&quot;. Falling back to &quot;%2&quot;.</source>
<translation>Zeichensatz &quot;%1&quot; kann nicht dekodiert werden. Verwende stattdessen &quot;%2&quot;.</translation>
@@ -42005,16 +42005,10 @@ Was soll %1 tun?</translation>
<source>Expected an integer in &quot;%1&quot;, but got &quot;%2&quot;.</source>
<translation>Statt eines Ganzzahlwerts wurde &quot;%2&quot; in &quot;%1&quot; gefunden.</translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::Notification</name>
<message>
<source>No parameters in &quot;%1&quot;.</source>
<translation>Keine Parameter in &quot;%1&quot;.</translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::Request</name>
<message>
<source>No ID set in &quot;%1&quot;.</source>
<translation>In &quot;%1&quot; ist keine ID angegeben.</translation>
@@ -50240,7 +50234,7 @@ Teilnamen können verwendet werden, sofern sie eindeutig sind.</translation>
</message>
</context>
<context>
<name>JsonRpcMessage</name>
<name>LanguageServerProtocol</name>
<message>
<source>Could not parse JSON message &quot;%1&quot;.</source>
<translation type="unfinished">Die JSON-Nachricht konnte nicht ausgewertet werden: &quot;%1&quot;.</translation>

View File

@@ -10737,7 +10737,7 @@ will also disable the following plugins:
</message>
</context>
<context>
<name>BaseMessage</name>
<name>LanguageServerProtocol</name>
<message>
<source>Unexpected header line &quot;%1&quot;.</source>
<translation>Neočekivani redak u zaglavlju &quot;%1&quot;.</translation>
@@ -10754,9 +10754,6 @@ will also disable the following plugins:
<source>Unexpected header field &quot;%1&quot; in &quot;%2&quot;.</source>
<translation>Neočekivano polje u zaglavlju &quot;%1&quot; u &quot;%2&quot;.</translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::JsonObject</name>
<message>
<source>Expected type %1 but value contained %2</source>
<translation>Očekivana vrsta %1, ali vrijednost je sadržavala %2</translation>
@@ -10774,7 +10771,7 @@ will also disable the following plugins:
</message>
</context>
<context>
<name>LanguageServerProtocol::Notification</name>
<name>LanguageServerProtocol</name>
<message>
<source>No parameters in &quot;%1&quot;.</source>
<translation>Nema parametara u &quot;%1&quot;.</translation>
@@ -10788,14 +10785,11 @@ will also disable the following plugins:
</message>
</context>
<context>
<name>LanguageServerProtocol::Request</name>
<name>LanguageServerProtocol</name>
<message>
<source>No ID set in &quot;%1&quot;.</source>
<translation>nema postavljene ID-oznake u &quot;%1&quot;.</translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::MarkedString</name>
<message>
<source>MarkedString should be either MarkedLanguageString, MarkupContent, or QList&lt;MarkedLanguageString&gt;.</source>
<translation type="unfinished"></translation>
@@ -10804,9 +10798,6 @@ will also disable the following plugins:
<source>DocumentFormattingProperty should be either bool, double, or QString.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageServerProtocoll::MarkupOrString</name>
<message>
<source>Expected a string or MarkupContent in MarkupOrString.</source>
<translation>Dupli klik za prikaz.</translation>

View File

@@ -43464,7 +43464,7 @@ Output:
</message>
</context>
<context>
<name>BaseMessage</name>
<name>LanguageServerProtocol</name>
<message>
<source>Cannot decode content with &quot;%1&quot;. Falling back to &quot;%2&quot;.</source>
<translation> &quot;%1&quot; &quot;%2&quot; </translation>
@@ -43473,9 +43473,6 @@ Output:
<source>Expected an integer in &quot;%1&quot;, but got &quot;%2&quot;.</source>
<translation>&quot;%1&quot; &quot;%2&quot; </translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::JsonObject</name>
<message>
<source>Expected type %1 but value contained %2</source>
<translation> %1 %2 </translation>
@@ -43497,7 +43494,7 @@ Output:
</message>
</context>
<context>
<name>LanguageServerProtocol::Notification</name>
<name>LanguageServerProtocol</name>
<message>
<source>No parameters in &quot;%1&quot;.</source>
<translation>&quot;%1&quot; </translation>
@@ -43511,28 +43508,19 @@ Output:
</message>
</context>
<context>
<name>LanguageServerProtocol::Request</name>
<name>LanguageServerProtocol</name>
<message>
<source>No ID set in &quot;%1&quot;.</source>
<translation>&quot;%1&quot; ID </translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::HoverContent</name>
<message>
<source>HoverContent should be either MarkedString, MarkupContent, or QList&lt;MarkedString&gt;.</source>
<translation>HoverContent MarkedStringMarkupContent QList&lt;MarkedString&gt; </translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::MarkedString</name>
<message>
<source>DocumentFormattingProperty should be either bool, double, or QString.</source>
<translation>DocumentFormattingProperty booldouble QString </translation>
</message>
</context>
<context>
<name>LanguageServerProtocoll::MarkupOrString</name>
<message>
<source>Expected a string or MarkupContent in MarkupOrString.</source>
<translation>MarkupOrString MarkupContent </translation>

View File

@@ -4059,7 +4059,7 @@ Warning: this is an experimental feature and might lead to failing to execute th
</message>
</context>
<context>
<name>BaseMessage</name>
<name>LanguageServerProtocol</name>
<message>
<source>Cannot decode content with &quot;%1&quot;. Falling back to &quot;%2&quot;.</source>
<translation>Нельзя преобразовать содержимое с помощью «%1». Возврат к «%2».</translation>
@@ -23822,14 +23822,11 @@ Error: %5</translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::HoverContent</name>
<name>LanguageServerProtocol</name>
<message>
<source>HoverContent should be either MarkedString, MarkupContent, or QList&lt;MarkedString&gt;.</source>
<translation>HoverContent должен быть или MarkedString, или MarkupContent, или QList&lt;MarkedString&gt;.</translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::JsonObject</name>
<message>
<source>Expected type %1 but value contained %2</source>
<translation>Ожидается тип %1, но значение содержит %2</translation>
@@ -23838,30 +23835,18 @@ Error: %5</translation>
<source>None of the following variants could be correctly parsed:</source>
<translation>Ни один из следующих вариантов невозможно корректно разобрать:</translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::MarkedString</name>
<message>
<source>DocumentFormattingProperty should be either bool, double, or QString.</source>
<translation>DocumentFormattingProperty должен быть или bool, или double, или QString.</translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::Notification</name>
<message>
<source>No parameters in &quot;%1&quot;.</source>
<translation>Нет параметров в «%1».</translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::Request</name>
<message>
<source>No ID set in &quot;%1&quot;.</source>
<translation>Не задан ID в «%1».</translation>
</message>
</context>
<context>
<name>LanguageServerProtocoll::MarkupOrString</name>
<message>
<source>Expected a string or MarkupContent in MarkupOrString.</source>
<translation>Ожидается string или MarkupContent в MarkupOrString.</translation>

View File

@@ -4321,7 +4321,7 @@ Warning: this is an experimental feature and might lead to failing to execute th
</message>
</context>
<context>
<name>BaseMessage</name>
<name>LanguageServerProtocol</name>
<message>
<source>Cannot decode content with &quot;%1&quot;. Falling back to &quot;%2&quot;.</source>
<translation type="unfinished"></translation>
@@ -23506,7 +23506,7 @@ Error: %5</source>
</message>
</context>
<context>
<name>JsonRpcMessage</name>
<name>LanguageServerProtocol</name>
<message>
<source>Could not parse JSON message &quot;%1&quot;.</source>
<translation type="unfinished"></translation>
@@ -23776,14 +23776,11 @@ Error: %5</source>
</message>
</context>
<context>
<name>LanguageServerProtocol::Notification</name>
<name>LanguageServerProtocol</name>
<message>
<source>No parameters in &quot;%1&quot;.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LanguageServerProtocol::Request</name>
<message>
<source>No ID set in &quot;%1&quot;.</source>
<translation type="unfinished"></translation>

View File

@@ -4,6 +4,7 @@
#include "basemessage.h"
#include "jsonrpcmessages.h"
#include "languageserverprotocoltr.h"
#include <QBuffer>
#include <QTextCodec>
@@ -80,10 +81,9 @@ static void parseContentType(BaseMessage &message, QByteArray contentType, QStri
if (equalindex > 0)
codec = QTextCodec::codecForName(charset);
if (!codec) {
parseError = BaseMessage::tr("Cannot decode content with \"%1\". "
"Falling back to \"%2\".")
.arg(QLatin1String(charset),
QLatin1String(defaultCharset));
parseError = Tr::tr("Cannot decode content with \"%1\". Falling back to \"%2\".")
.arg(QLatin1String(charset),
QLatin1String(defaultCharset));
}
}
}
@@ -96,7 +96,7 @@ static void parseContentLength(BaseMessage &message, QByteArray contentLength, Q
bool ok = true;
message.contentLength = contentLength.toInt(&ok);
if (!ok) {
parseError = BaseMessage::tr("Expected an integer in \"%1\", but got \"%2\".")
parseError = Tr::tr("Expected an integer in \"%1\", but got \"%2\".")
.arg(QString::fromLatin1(contentLengthFieldName), QString::fromLatin1(contentLength));
}
}

View File

@@ -20,7 +20,6 @@ LANGUAGESERVERPROTOCOL_EXPORT Q_DECLARE_LOGGING_CATEGORY(parseLog)
class LANGUAGESERVERPROTOCOL_EXPORT BaseMessage
{
Q_DECLARE_TR_FUNCTIONS(BaseMessage)
public:
BaseMessage();
BaseMessage(const QByteArray &mimeType, const QByteArray &content,

View File

@@ -14,8 +14,6 @@ namespace LanguageServerProtocol {
class LANGUAGESERVERPROTOCOL_EXPORT JsonObject
{
Q_DECLARE_TR_FUNCTIONS(LanguageServerProtocol::JsonObject)
public:
using iterator = QJsonObject::iterator;
using const_iterator = QJsonObject::const_iterator;

View File

@@ -3,8 +3,9 @@
#include "jsonrpcmessages.h"
#include "lsputils.h"
#include "initializemessages.h"
#include "languageserverprotocoltr.h"
#include "lsputils.h"
#include <utils/qtcassert.h>
@@ -76,9 +77,11 @@ JsonRpcMessage::JsonRpcMessage(const BaseMessage &message)
if (doc.isObject())
m_jsonObject = doc.object();
else if (doc.isNull())
m_parseError = tr("Could not parse JSON message \"%1\".").arg(error.errorString());
m_parseError =
Tr::tr("Could not parse JSON message \"%1\".").arg(error.errorString());
else
m_parseError = tr("Expected a JSON object, but got a JSON \"%1\" value.").arg(docType(doc));
m_parseError =
Tr::tr("Expected a JSON object, but got a JSON \"%1\" value.").arg(docType(doc));
}
JsonRpcMessage::JsonRpcMessage(const QJsonObject &jsonObject)

View File

@@ -4,8 +4,9 @@
#pragma once
#include "basemessage.h"
#include "lsptypes.h"
#include "jsonkeys.h"
#include "languageserverprotocoltr.h"
#include "lsptypes.h"
#include <utils/qtcassert.h>
@@ -94,7 +95,6 @@ struct ResponseHandler
class LANGUAGESERVERPROTOCOL_EXPORT JsonRpcMessage
{
Q_DECLARE_TR_FUNCTIONS(JsonRpcMessage)
public:
JsonRpcMessage();
explicit JsonRpcMessage(const BaseMessage &message);
@@ -163,8 +163,7 @@ public:
if (auto parameter = params())
return parameter->isValid();
if (errorMessage)
*errorMessage = QCoreApplication::translate("LanguageServerProtocol::Notification",
"No parameters in \"%1\".").arg(method());
*errorMessage = Tr::tr("No parameters in \"%1\".").arg(method());
return false;
}
};
@@ -254,8 +253,7 @@ public:
CASE_ERRORCODES(ServerNotInitialized);
CASE_ERRORCODES(RequestCancelled);
default:
return QCoreApplication::translate("LanguageClient::ResponseError",
"Error %1").arg(code);
return QCoreApplication::translate("::LanguageClient", "Error %1").arg(code);
}
}
#undef CASE_ERRORCODES
@@ -376,10 +374,8 @@ public:
return false;
if (id().isValid())
return true;
if (errorMessage) {
*errorMessage = QCoreApplication::translate("LanguageServerProtocol::Request",
"No ID set in \"%1\".").arg(this->method());
}
if (errorMessage)
*errorMessage = Tr::tr("No ID set in \"%1\".").arg(this->method());
return false;
}