From 999cd8f31c6c2d01ffb216d95ea19e8a50a72234 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 10 Sep 2014 22:25:59 +0300 Subject: in po rule not check fuzzy translations. --- src/rules/po.cpp | 13 ++++++++++++- tests/testreport.txt | 6 ------ tests/testsrc/good/ru.po | 3 ++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/rules/po.cpp b/src/rules/po.cpp index fadc650..7725177 100644 --- a/src/rules/po.cpp +++ b/src/rules/po.cpp @@ -24,6 +24,7 @@ registerRuleExt(po, "010", "(.+)[.](po)") bool readId(false); bool readStr(false); +bool skipOneCheck(false); std::string msgId; std::string msgStr; @@ -34,6 +35,11 @@ static void processMessage(RuleBase *const rule) readId = false; readStr = false; + if (skipOneCheck) + { + skipOneCheck = false; + return; + } // skip not translated lines if (msgStr.empty()) return; @@ -97,6 +103,7 @@ startRule(po) { readId = false; readStr = false; + skipOneCheck = false; msgId = std::string(); msgStr = std::string(); } @@ -109,7 +116,11 @@ endRule(po) parseLineRule(po) { - if (findCutFirst(data, "msgid \"")) + if (strStartWith(data, "#, fuzzy")) + { + skipOneCheck = true; + } + else if (findCutFirst(data, "msgid \"")) { // msgId start if (readStr) { diff --git a/tests/testreport.txt b/tests/testreport.txt index 69c4c3a..5689407 100644 --- a/tests/testreport.txt +++ b/tests/testreport.txt @@ -41,10 +41,4 @@ [testsrc/bad/license5.h:3]: V005: Missing copyrights section [testsrc/bad/license6.cpp:5]: V005: Missing "This file is part of The ManaPlus Client." [testsrc/bad/license6.h:5]: V005: Missing "This file is part of The ManaPlus Client." -[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:496]: V010: Wrong character at end of translation line. -[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/good/ru.po b/tests/testsrc/good/ru.po index b3599f6..8e69ba5 100644 --- a/tests/testsrc/good/ru.po +++ b/tests/testsrc/good/ru.po @@ -7992,8 +7992,9 @@ msgstr "Торговля завершена." #. TRANSLATORS: notification message #: src/resources/notifications.h:264 +#, fuzzy msgid "Kick failed!" -msgstr "Не удалось вышвырнуть!" +msgstr "Не удалось вышвырнуть" #. TRANSLATORS: notification message #: src/resources/notifications.h:268 -- cgit v1.2.3-60-g2f50