Commit ad57681f authored by Michal Čihař's avatar Michal Čihař

Another method which could be function

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 88a621e5
......@@ -880,6 +880,14 @@ def strip_chars(word):
)
def test_word(word):
'''
Test whether word should be ignored.
'''
stripped = strip_chars(word)
return len(stripped) <= 1 or stripped in SAME_BLACKLIST
class SameCheck(TargetCheck):
'''
Check for not translated entries.
......@@ -888,13 +896,6 @@ class SameCheck(TargetCheck):
name = _('Not translated')
description = _('Source and translated strings are same')
def test_word(self, word):
'''
Test whether word should be ignored.
'''
stripped = strip_chars(word)
return len(stripped) <= 1 or stripped in SAME_BLACKLIST
def should_ignore(self, source, unit, cache_slot):
'''
Check whether given unit should be ignored.
......@@ -924,7 +925,7 @@ class SameCheck(TargetCheck):
# Check if we have any word which is not in blacklist
# (words which are often same in foreign language)
result = min(
(self.test_word(word) for word in stripped.split())
(test_word(word) for word in stripped.split())
)
# Store in cache
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment