Commit 0e714fae authored by Michal Čihař's avatar Michal Čihař

Merge remote-tracking branch 'origin/master'

parents 2d8a7eee 36384184
...@@ -116,6 +116,8 @@ Not translated ...@@ -116,6 +116,8 @@ Not translated
++++++++++++++ ++++++++++++++
The source and translated strings are same at least in one of plural forms. The source and translated strings are same at least in one of plural forms.
This checks ignores some strings which are quite usually same in all
languages.
.. _check-begin_newline: .. _check-begin_newline:
......
...@@ -36,6 +36,39 @@ C_PRINTF_MATCH = re.compile(''' ...@@ -36,6 +36,39 @@ C_PRINTF_MATCH = re.compile('''
(?P<type>[\w%])) # type (%s, %d, etc.) (?P<type>[\w%])) # type (%s, %d, etc.)
)''', re.VERBOSE) )''', re.VERBOSE)
# We ignore some words which are usually not translated
SAME_BLACKLIST = [
'b',
'bzip2',
'data',
'e-mail',
'eib',
'export',
'firmware',
'gib',
'gzip',
'id',
'imei',
'import',
'kib',
'latex',
'mib',
'ok',
'open document',
'pdf',
'pib',
'port',
'server',
'sim',
'smsc',
'software',
'sql',
'text',
'tib',
'wiki',
'xml',
'zip',
]
CHECKS = {} CHECKS = {}
...@@ -61,6 +94,8 @@ def plural_check(f): ...@@ -61,6 +94,8 @@ def plural_check(f):
def check_same(source, target, flags, language): def check_same(source, target, flags, language):
if language.code.split('_')[0] == 'en': if language.code.split('_')[0] == 'en':
return False return False
if source.lower() in SAME_BLACKLIST:
return False
return (source == target) return (source == target)
CHECKS['same'] = (_('Not translated'), check_same, _('Source and translated strings are same')) CHECKS['same'] = (_('Not translated'), check_same, _('Source and translated strings are same'))
......
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