trans lint: also allow missing %1$s for zero,one,two plural translations

This commit is contained in:
Thibault Duplessis 2020-02-10 14:46:56 -06:00
parent b6f0c6470e
commit 5d4744abac

View file

@ -86,9 +86,7 @@ def lint_string(path, el, name, dest, source, allow_missing=0):
for placeholder in re.findall(r"%\d+\$s", source):
if placeholder == "%1$s" and placeholder not in dest and allow_missing > 0:
print(warning(path, el, f"missing %1$s: {name} {dest}"))
allow_missing -= 1
warns += 1
elif dest.count(placeholder) < 1:
print(error(path, el, f"missing {placeholder}: {name} {dest}"))
errs += 1