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),
headerFieldLine.mid(assignmentIndex + fieldSeparatorLength)};
}
parseError = BaseMessage::tr("Unexpected header line \"%1\"")
parseError = BaseMessage::tr("Unexpected header line \"%1\".")
.arg(QLatin1String(headerFieldLine));
return {};
}
@@ -97,8 +97,8 @@ 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\"")
parseError = BaseMessage::tr("Cannot decode content with \"%1\". "
"Falling back to \"%2\".")
.arg(QLatin1String(charset),
QLatin1String(defaultCharset));
}
@@ -113,7 +113,7 @@ static void parseContentLength(BaseMessage &message, QByteArray contentLength, Q
bool ok = true;
message.contentLength = QString::fromLatin1(contentLength).toInt(&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));
}
}
@@ -146,7 +146,7 @@ void BaseMessage::parse(QBuffer *data, QString &parseError, BaseMessage &message
} else if (headerFieldName == contentTypeFieldName) {
parseContentType(message, headerFieldValue, parseError);
} else {
parseError = tr("Unexpected header field \"%1\" in \"%2\"")
parseError = tr("Unexpected header field \"%1\" in \"%2\".")
.arg(QLatin1String(headerFieldName),
QLatin1String(headerFieldLine));
}

View File

@@ -104,7 +104,7 @@ QString JsonObject::valueTypeString(QJsonValue::Type type)
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));
}

View File

@@ -141,9 +141,9 @@ QJsonObject JsonRpcMessageHandler::toJsonObject(const QByteArray &_content,
if (doc.isObject())
return doc.object();
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
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();
}

View File

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

View File

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

View File

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