summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rules/po.cpp24
-rw-r--r--tests/testreport.txt1
-rw-r--r--tests/testsrc/bad/uk.po2
3 files changed, 25 insertions, 2 deletions
diff --git a/src/rules/po.cpp b/src/rules/po.cpp
index 0aab5c5..fadc650 100644
--- a/src/rules/po.cpp
+++ b/src/rules/po.cpp
@@ -63,11 +63,33 @@ static void processMessage(RuleBase *const rule)
if (findCutLast(name, "po/ar.po") || findCutLast(name, "po/fa.po"))
return;
- if (cId == '.' || cId == ',' ||cId == '!' || cId == '?' || cId == '-')
+ if (cId == '.' || cId == ',' || cId == '!' || cId == '?' || cId == '-'
+ || cId == ':' || cId == ';' || cId == '+' || cId == '|'
+ || cId == ' ')
{
if (cId != cStr)
rule->print("Wrong character at end of translation line.");
}
+ if (msgId.find("###") != std::string::npos
+ && msgStr.find("###") == std::string::npos)
+ {
+ rule->print("Missing ### in translation.");
+ }
+/*
+ if (msgId.find("\\n") != std::string::npos)
+ {
+ if (!findCutLast(name, "help/zh_CN.po"))
+ {
+ if (msgStr.find("\\n") == std::string::npos)
+ rule->print("Missing \\n in translation.");
+ }
+ }
+ else
+ {
+ if (msgStr.find("\\n") != std::string::npos)
+ rule->print("Useless \\n in translation.");
+ }
+*/
}
}
diff --git a/tests/testreport.txt b/tests/testreport.txt
index 65d6dc4..69b59bf 100644
--- a/tests/testreport.txt
+++ b/tests/testreport.txt
@@ -37,5 +37,6 @@
[testsrc/bad/uk.po:1835]: V010: Wrong character at end of translation line.
[testsrc/bad/uk.po:2253]: V010: Useless space at end of translation line.
[testsrc/bad/uk.po:2257]: V010: Wrong character at end of translation line.
+[testsrc/bad/uk.po:44]: V010: Missing ### in translation.
[testsrc/bad/uk.po:919]: V010: Useless space at end of translation line.
[testsrc/bad/uk.po:98]: V010: Useless space at end of translation line.
diff --git a/tests/testsrc/bad/uk.po b/tests/testsrc/bad/uk.po
index a84995a..c9c6c77 100644
--- a/tests/testsrc/bad/uk.po
+++ b/tests/testsrc/bad/uk.po
@@ -39,7 +39,7 @@ msgstr ""
#: src/client.cpp:739
#, fuzzy
-msgid "Requesting characters"
+msgid "Requesting characters### test."
msgstr "Вимагається приєднання до каналу %s."
#: src/client.cpp:768