[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r2768: Escape dquotes in strings when converting .ts -> .po, and un (in vidalia/trunk/src/tools: po2ts ts2po)
Author: edmanm
Date: 2008-06-19 19:29:16 -0400 (Thu, 19 Jun 2008)
New Revision: 2768
Modified:
vidalia/trunk/src/tools/po2ts/po2ts.cpp
vidalia/trunk/src/tools/ts2po/ts2po.cpp
Log:
Escape dquotes in strings when converting .ts -> .po, and unescape them when
converting .po -> .ts.
Modified: vidalia/trunk/src/tools/po2ts/po2ts.cpp
===================================================================
--- vidalia/trunk/src/tools/po2ts/po2ts.cpp 2008-06-19 22:36:52 UTC (rev 2767)
+++ vidalia/trunk/src/tools/po2ts/po2ts.cpp 2008-06-19 23:29:16 UTC (rev 2768)
@@ -106,6 +106,7 @@
out = out.remove(0, 1);
if (out.endsWith("\""))
out.chop(1);
+ out.replace("\\\"", "\"");
return out;
}
Modified: vidalia/trunk/src/tools/ts2po/ts2po.cpp
===================================================================
--- vidalia/trunk/src/tools/ts2po/ts2po.cpp 2008-06-19 22:36:52 UTC (rev 2767)
+++ vidalia/trunk/src/tools/ts2po/ts2po.cpp 2008-06-19 23:29:16 UTC (rev 2768)
@@ -88,12 +88,14 @@
}
msgid = source.text();
msgid.replace("\r", "");
+ msgid.replace("\"", "\\\"");
msgid.replace("\n", "\"\n\"");
/* Extract the <translation> tags */
translation = msg.firstChildElement(TS_ELEMENT_TRANSLATION);
msgstr = translation.text();
msgstr.replace("\r", "");
+ msgstr.replace("\"", "\\\"");
msgstr.replace("\n", "\"\n\"");
/* Format the .po entry for this string */