|
From: Thomas F. <tho...@ru...> - 2015-02-05 17:15:11
|
Git commit ad661e3dac9c678c1bf8999098318bd428fd2bef by Thomas Friedrichsmeier. Committed on 05/02/2015 at 17:13. Pushed by tfry into branch 'releases/0.6.3'. Don't try to translate empty strings M +6 -2 rkward/misc/xmlhelper.cpp http://commits.kde.org/rkward/ad661e3dac9c678c1bf8999098318bd428fd2bef 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) { |