trans lint: also allow missing %1$s for zero,one,two plural translations
This commit is contained in:
parent
b6f0c6470e
commit
5d4744abac
|
@ -86,9 +86,7 @@ def lint_string(path, el, name, dest, source, allow_missing=0):
|
||||||
|
|
||||||
for placeholder in re.findall(r"%\d+\$s", source):
|
for placeholder in re.findall(r"%\d+\$s", source):
|
||||||
if placeholder == "%1$s" and placeholder not in dest and allow_missing > 0:
|
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
|
allow_missing -= 1
|
||||||
warns += 1
|
|
||||||
elif dest.count(placeholder) < 1:
|
elif dest.count(placeholder) < 1:
|
||||||
print(error(path, el, f"missing {placeholder}: {name} {dest}"))
|
print(error(path, el, f"missing {placeholder}: {name} {dest}"))
|
||||||
errs += 1
|
errs += 1
|
||||||
|
|
Loading…
Reference in a new issue