LSP: Fix punctuation and capitalization of UI text

Change-Id: Ifc04d979ec7e989ed50d6af23d18819dd91dc0be
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Leena Miettinen
2018-10-19 13:01:37 +02:00
parent 89fe2681f7
commit 22547c1ca4
6 changed files with 13 additions and 13 deletions

View File

@@ -77,7 +77,7 @@ static QPair<QByteArray, QByteArray> splitHeaderFieldLine(
return {headerFieldLine.mid(0, assignmentIndex), return {headerFieldLine.mid(0, assignmentIndex),
headerFieldLine.mid(assignmentIndex + fieldSeparatorLength)}; headerFieldLine.mid(assignmentIndex + fieldSeparatorLength)};
} }
parseError = BaseMessage::tr("Unexpected header line \"%1\"") parseError = BaseMessage::tr("Unexpected header line \"%1\".")
.arg(QLatin1String(headerFieldLine)); .arg(QLatin1String(headerFieldLine));
return {}; return {};
} }
@@ -97,8 +97,8 @@ static void parseContentType(BaseMessage &message, QByteArray contentType, QStri
if (equalindex > 0) if (equalindex > 0)
codec = QTextCodec::codecForName(charset); codec = QTextCodec::codecForName(charset);
if (!codec) { if (!codec) {
parseError = BaseMessage::tr("Cannot decode content with \"%1\" " parseError = BaseMessage::tr("Cannot decode content with \"%1\". "
"falling back to \"%2\"") "Falling back to \"%2\".")
.arg(QLatin1String(charset), .arg(QLatin1String(charset),
QLatin1String(defaultCharset)); QLatin1String(defaultCharset));
} }
@@ -113,7 +113,7 @@ static void parseContentLength(BaseMessage &message, QByteArray contentLength, Q
bool ok = true; bool ok = true;
message.contentLength = QString::fromLatin1(contentLength).toInt(&ok); message.contentLength = QString::fromLatin1(contentLength).toInt(&ok);
if (!ok) { if (!ok) {
parseError = BaseMessage::tr("Expected an integer in \"%1\", but got \"%2\"") parseError = BaseMessage::tr("Expected an integer in \"%1\", but got \"%2\".")
.arg(contentLengthFieldName, QLatin1String(contentLength)); .arg(contentLengthFieldName, QLatin1String(contentLength));
} }
} }
@@ -146,7 +146,7 @@ void BaseMessage::parse(QBuffer *data, QString &parseError, BaseMessage &message
} else if (headerFieldName == contentTypeFieldName) { } else if (headerFieldName == contentTypeFieldName) {
parseContentType(message, headerFieldValue, parseError); parseContentType(message, headerFieldValue, parseError);
} else { } else {
parseError = tr("Unexpected header field \"%1\" in \"%2\"") parseError = tr("Unexpected header field \"%1\" in \"%2\".")
.arg(QLatin1String(headerFieldName), .arg(QLatin1String(headerFieldName),
QLatin1String(headerFieldLine)); QLatin1String(headerFieldLine));
} }

View File

@@ -104,7 +104,7 @@ QString JsonObject::valueTypeString(QJsonValue::Type type)
QString JsonObject::errorString(QJsonValue::Type expected, QJsonValue::Type actual) QString JsonObject::errorString(QJsonValue::Type expected, QJsonValue::Type actual)
{ {
return tr("Expected Type %1 but value contained %2") return tr("Expected type %1 but value contained %2")
.arg(valueTypeString(expected), valueTypeString(actual)); .arg(valueTypeString(expected), valueTypeString(actual));
} }

View File

@@ -141,9 +141,9 @@ QJsonObject JsonRpcMessageHandler::toJsonObject(const QByteArray &_content,
if (doc.isObject()) if (doc.isObject())
return doc.object(); return doc.object();
if (doc.isNull()) if (doc.isNull())
parseError = tr("Could not parse Json message '%1'").arg(error.errorString()); parseError = tr("Could not parse JSON message \"%1\".").arg(error.errorString());
else else
parseError = tr("Expected Json object, but got a json '%1'").arg(docTypeName(doc)); parseError = tr("Expected a JSON object, but got a JSON \"%1\".").arg(docTypeName(doc));
return QJsonObject(); return QJsonObject();
} }

View File

@@ -125,7 +125,7 @@ public:
} }
if (errorMessage) if (errorMessage)
*errorMessage = QCoreApplication::translate("LanguageServerProtocol::Notification", *errorMessage = QCoreApplication::translate("LanguageServerProtocol::Notification",
"No parameters in '%1'").arg(method()); "No parameters in \"%1\".").arg(method());
return false; return false;
} }
}; };
@@ -274,7 +274,7 @@ public:
return true; return true;
if (errorMessage) { if (errorMessage) {
*errorMessage = QCoreApplication::translate("LanguageServerProtocol::Request", *errorMessage = QCoreApplication::translate("LanguageServerProtocol::Request",
"No id set in '%1'").arg(this->method()); "No ID set in \"%1\".").arg(this->method());
} }
return false; return false;
} }

View File

@@ -331,7 +331,7 @@ bool MarkedString::isValid(QStringList *errorHierarchy) const
*errorHierarchy << QCoreApplication::translate( *errorHierarchy << QCoreApplication::translate(
"LanguageServerProtocol::MarkedString", "LanguageServerProtocol::MarkedString",
"MarkedString should be either MarkedLanguageString, " "MarkedString should be either MarkedLanguageString, "
"MarkupContent or QList<MarkedLanguageString>"); "MarkupContent, or QList<MarkedLanguageString>.");
} }
return false; return false;
} }
@@ -356,7 +356,7 @@ bool DocumentFormattingProperty::isValid(QStringList *error) const
if (error) { if (error) {
*error << QCoreApplication::translate( *error << QCoreApplication::translate(
"LanguageServerProtocol::MarkedString", "LanguageServerProtocol::MarkedString",
"DocumentFormattingProperty should be either bool, double or QString"); "DocumentFormattingProperty should be either bool, double, or QString.");
} }
return false; return false;
} }

View File

@@ -136,7 +136,7 @@ bool MarkupOrString::isValid(QStringList *error) const
return true; return true;
if (error) { if (error) {
*error << QCoreApplication::translate("LanguageServerProtocoll::MarkupOrString", *error << QCoreApplication::translate("LanguageServerProtocoll::MarkupOrString",
"Expected a string or MarkupContent in MarkupOrString"); "Expected a string or MarkupContent in MarkupOrString.");
} }
return false; return false;
} }