[rkward-cvs] [rkward] /: Fix some message lookup failures, due to insufficient normalization of markup.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Feb 5 20:18:56 UTC 2015


Git commit 845f3d23dcb57ff78201828fdef636a2ee83a47f by Thomas Friedrichsmeier.
Committed on 05/02/2015 at 20:16.
Pushed by tfry into branch 'master'.

Fix some message lookup failures, due to insufficient normalization of markup.

M  +3    -0    ChangeLog
M  +5    -0    rkward/misc/xmlhelper.cpp

http://commits.kde.org/rkward/845f3d23dcb57ff78201828fdef636a2ee83a47f

diff --git a/ChangeLog b/ChangeLog
index ab9f9f8..81a75c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+Next release TODO:
+- Properly fix normalization of markup within messages between python / qt.
+
 --- Version 0.6.3 - XXXXXXXXXXX
 - Fixed: Hang when trying to select existing directories in file selectors on Windows
 - New element <i18n> for use in plugins' logic section: Provides a translatable string property
diff --git a/rkward/misc/xmlhelper.cpp b/rkward/misc/xmlhelper.cpp
index bb60f80..d6fd815 100644
--- a/rkward/misc/xmlhelper.cpp
+++ b/rkward/misc/xmlhelper.cpp
@@ -344,6 +344,11 @@ QString XMLHelper::i18nElementText (const QDomElement &element, bool with_paragr
 		QString para = paras[i].simplified ();
 		if (!para.isEmpty ()) {
 			if (!ret.isEmpty ()) ret.append ("\n");
+			// Oh, crap. Fix up after some differences between python message extraction and qt's.
+			para.replace ("<li> <", "<li><");
+			para.replace ("br> <", "br><");
+			para.replace ("> </li>", "></li>");
+			para.replace ("&", "&");
 			QString text = context.isNull () ? catalog->translate (para) : catalog->translate (context, para);
 			if (with_paragraphs) ret += "<p>" + text + "</p>";
 			else ret += text;


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
rkward-cvs mailing list
rkward-cvs at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-cvs


More information about the rkward-tracker mailing list