From 971e3ef054af935eb2a0b8b11c7fb53a86dd00c7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 4 Jan 2016 20:23:22 +0300 Subject: Add check in po files for start and end quotes. --- src/rules/po.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/rules/po.cpp b/src/rules/po.cpp index b8390e4..ab40041 100644 --- a/src/rules/po.cpp +++ b/src/rules/po.cpp @@ -121,6 +121,18 @@ static void processMessage(RuleBase *const rule) isError = true; } } + if (strStartWith(msgId, "\\\"") && strEndWith(msgId, "\\\"") && + !strStartWith(msgStr, "\\\"") && !strEndWith(msgStr, "\\\"")) + { + rule->print("Missing \" at start and at end of translated line."); + isError = true; + } + if (strStartWith(msgStr, "\\\"") && strEndWith(msgStr, "\\\"") && + !strStartWith(msgId, "\\\"") && !strEndWith(msgId, "\\\"")) + { + rule->print("Extra \" at start and at end of translated line."); + isError = true; + } if (msgId.find("###") != std::string::npos && msgStr.find("###") == std::string::npos) { -- cgit v1.2.3-70-g09d2