diff options
-rw-r--r-- | src/rules/po.cpp | 12 | ||||
-rw-r--r-- | tests/testreport.txt | 3 | ||||
-rw-r--r-- | tests/testsrc/bad/uk.po | 4 | ||||
-rw-r--r-- | tests/testsrc/good/ru.po | 4 |
4 files changed, 19 insertions, 4 deletions
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) { diff --git a/tests/testreport.txt b/tests/testreport.txt index b555001..c8ac058 100644 --- a/tests/testreport.txt +++ b/tests/testreport.txt @@ -44,6 +44,9 @@ [testsrc/bad/packet.cpp:25]: V012: Wrong output packet creation. Must be 'createOutPacket(CMSG...' [testsrc/bad/translation.cpp:27]: V014: Missing "// TRANSLATORS: " comment before this line. [testsrc/bad/translation.cpp:32]: V014: Missing "// TRANSLATORS: " comment before this line. +[testsrc/bad/uk.po:162]: V010: Extra " at start and at end of translated line. +[testsrc/bad/uk.po:162]: V010: Wrong character at start of translation line. +[testsrc/bad/uk.po:166]: V010: Missing " at start and at end of translated line. [testsrc/bad/uk.po:2257]: V010: Wrong character at end of translation line. [testsrc/bad/uk.po:2269]: V010: Wrong character at start of translation line. [testsrc/bad/uk.po:2535]: V010: Wrong number of spaces at start of translation line. diff --git a/tests/testsrc/bad/uk.po b/tests/testsrc/bad/uk.po index 9f6c414..dad5330 100644 --- a/tests/testsrc/bad/uk.po +++ b/tests/testsrc/bad/uk.po @@ -158,10 +158,10 @@ msgstr "" #: src/commandhandler.cpp:174 msgid "/list > Display all public channels" -msgstr "/list > Показати усі публічні канали" +msgstr "\"/list > Показати усі публічні канали\"" #: src/commandhandler.cpp:175 -msgid "/join > Join or create a channel" +msgid "\"/join > Join or create a channel\"" msgstr "/join > Приєднатись чи створити канал" #: src/commandhandler.cpp:177 diff --git a/tests/testsrc/good/ru.po b/tests/testsrc/good/ru.po index 8e69ba5..4fa7516 100644 --- a/tests/testsrc/good/ru.po +++ b/tests/testsrc/good/ru.po @@ -7295,8 +7295,8 @@ msgstr "Пустой адрес был передан методу Network::conn #. TRANSLATORS: error message #: src/net/ea/network.cpp:202 -msgid "Unable to resolve host \"" -msgstr "Не удалось найти хост \"" +msgid "\"Unable to resolve host\"" +msgstr "\"Не удалось найти хост\"" #. TRANSLATORS: error message #: src/net/ea/network.cpp:283 |