Git commit 2bd63162b2760fe53ddba6c6801f1336d17eff60 by Thomas Friedrichsmeier.
Committed on 05/02/2015 at 17:13.
Pushed by tfry into branch 'master'.
Don't try to translate empty strings
M +6 -2 rkward/misc/xmlhelper.cpp
http://commits.kde.org/rkward/2bd63162b2760fe53ddba6c6801f1336d17eff60
diff --git a/rkward/misc/xmlhelper.cpp b/rkward/misc/xmlhelper.cpp
index d18c068..bb60f80 100644
--- a/rkward/misc/xmlhelper.cpp
+++ b/rkward/misc/xmlhelper.cpp
@@ -247,9 +247,13 @@ QString XMLHelper::i18nStringAttribute (const QDomElement& element, const QStrin
displayError (&element, i18n ("'%1'-attribute not given. Assuming '%2'", name, def), debug_level);
return def;
}
+
+ QString attr = element.attribute (name);
+ if (attr.isEmpty ()) return attr; // Do not translate empty strings!
+
const QString context = element.attribute ("i18n_context", QString ());
- if (!context.isNull ()) return (catalog->translate (context, element.attribute (name)));
- return (catalog->translate (element.attribute (name)));
+ if (!context.isNull ()) return (catalog->translate (context, attr));
+ return (catalog->translate (attr));
}
int XMLHelper::getMultiChoiceAttribute (const QDomElement &element, const QString &name, const QString &values, int def, int debug_level) {
|