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

Ignore short strings for same check

parent 352ff3a2
...@@ -107,9 +107,14 @@ def plural_check(f): ...@@ -107,9 +107,14 @@ def plural_check(f):
@plural_check @plural_check
def check_same(source, target, flags, language, unit): def check_same(source, target, flags, language, unit):
# One letter things are usually labels or decimal/thousand separators
if len(source) == 1 and len(target) == 1:
return False
# English variants will have most things not translated # English variants will have most things not translated
if language.code.split('_')[0] == 'en': if language.code.split('_')[0] == 'en':
return False return False
# Ignore words which are often same in foreigh language # Ignore words which are often same in foreigh language
if source.lower() in SAME_BLACKLIST or source.lower().rstrip(': ') in SAME_BLACKLIST: if source.lower() in SAME_BLACKLIST or source.lower().rstrip(': ') in SAME_BLACKLIST:
return False return False
...@@ -146,7 +151,8 @@ CHECKS['end_newline'] = (_('Trailing newline'), check_end_newline, _('Source and ...@@ -146,7 +151,8 @@ CHECKS['end_newline'] = (_('Trailing newline'), check_end_newline, _('Source and
@plural_check @plural_check
def check_end_space(source, target, flags, language, unit): def check_end_space(source, target, flags, language, unit):
if len(source) == 1 and len(target) == 1: # One letter things are usually decimal/thousand separators
if len(source) == 1 and len(target) <= 1:
return False return False
if language.code.split('_')[0] in ['fr', 'br']: if language.code.split('_')[0] in ['fr', 'br']:
if len(target) == 0: if len(target) == 0:
......
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