Commit 3c6b01f3 authored by Michal Čihař's avatar Michal Čihař

Add check for missing plural forms

parent 15439a8e
......@@ -128,3 +128,14 @@ def check_c_format(source, target, flags):
return check_format_strings(source, target, C_PRINTF_MATCH)
CHECKS['c_format'] = (_('C format'), check_c_format, _('Format string does not match source'))
# Check for incomplete plural forms
def check_plurals(sources, targets, flags):
if len(sources) == 1:
return False
if targets == len(targets) * ['']:
return False
return ('' in targets)
CHECKS['plurals'] = (_('Missing plurals'), check_c_format, _('Some plural forms are not translated'))
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