[kde-doc-english] [kxstitch] src: Make error messages translatable
Steve Allewell
steve.allewell at gmail.com
Fri Dec 25 00:39:49 UTC 2015
Git commit 070c59d2a2d57ed9862a23a9c2a7a7de52e0aff0 by Steve Allewell.
Committed on 25/12/2015 at 00:38.
Pushed by sallewell into branch 'master'.
Make error messages translatable
GUI:
M +8 -9 src/SchemeParser.cpp
http://commits.kde.org/kxstitch/070c59d2a2d57ed9862a23a9c2a7a7de52e0aff0
diff --git a/src/SchemeParser.cpp b/src/SchemeParser.cpp
index cdf12b4..a727edc 100644
--- a/src/SchemeParser.cpp
+++ b/src/SchemeParser.cpp
@@ -41,15 +41,14 @@ const QStringList validTags = {
/**
Error messages.
- TODO these need to be translatable
*/
-const QStringList errorMessages = {
- QStringLiteral("No error"),
- QStringLiteral("Floss not completely defined"),
- QStringLiteral("Unmatched element tags"),
- QStringLiteral("Unknown element tag"),
- QStringLiteral("Color value is invalid"),
- QStringLiteral("Unknown error code")
+const char *errorMessages[] = {
+ I18N_NOOP("No error"),
+ I18N_NOOP("Floss not completely defined"),
+ I18N_NOOP("Unmatched element tags"),
+ I18N_NOOP("Unknown element tag"),
+ I18N_NOOP("Color value is invalid"),
+ I18N_NOOP("Unknown error code")
};
@@ -187,5 +186,5 @@ bool SchemeParser::endElement(const QString &namespaceURI, const QString &localN
*/
QString SchemeParser::errorString() const
{
- return errorMessages.at(m_errorCode);
+ return i18n(errorMessages[m_errorCode]);
}
More information about the kde-doc-english
mailing list