summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-10 22:25:59 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-10 22:25:59 +0300
commit999cd8f31c6c2d01ffb216d95ea19e8a50a72234 (patch)
treeef7858a8b7dc6af5fba10577a3fb8a63cffe6094
parent78e79af6fd2a6bb5400b6a7aa82fba2df9c234e9 (diff)
downloadmplint-999cd8f31c6c2d01ffb216d95ea19e8a50a72234.tar.gz
mplint-999cd8f31c6c2d01ffb216d95ea19e8a50a72234.tar.bz2
mplint-999cd8f31c6c2d01ffb216d95ea19e8a50a72234.tar.xz
mplint-999cd8f31c6c2d01ffb216d95ea19e8a50a72234.zip
in po rule not check fuzzy translations.
-rw-r--r--src/rules/po.cpp13
-rw-r--r--tests/testreport.txt6
-rw-r--r--tests/testsrc/good/ru.po3
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