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

Ignore copyright statements from checks

parent b4431ebb
......@@ -148,6 +148,12 @@ class SameCheck(TargetCheck):
if len(source.strip('0123456789:/,.')) <= 1:
return False
lower_source = source.lower()
# Skip copyright
if '(c) copyright' in lower_source or u'©' in source:
return False
# Ignore strings which don't contain any string to translate
if self.is_format_only(source, flags):
return False
......@@ -161,7 +167,7 @@ class SameCheck(TargetCheck):
return False
# Ignore words which are often same in foreigh language
if source.lower().strip('_&: ') in SAME_BLACKLIST:
if lower_source.strip('_&: ') in SAME_BLACKLIST:
return False
return (source == target)
......@@ -49,3 +49,21 @@ class SameCheckTest(CheckTestCase):
def test_same_numbers(self):
self.do_test(False, ('1:4', '1:4', ''))
def test_same_copyright(self):
self.do_test(
False,
(
u'(c) Copyright 2013 Michal Čihař',
u'(c) Copyright 2013 Michal Čihař',
''
)
)
self.do_test(
False,
(
u'© Copyright 2013 Michal Čihař',
u'© Copyright 2013 Michal Čihař',
''
)
)
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