wmllint: As requested, adding recognition of WebP image labels.

Extension of #7079.
This commit is contained in:
Wedge009 2022-11-03 11:26:30 +11:00
parent c8a0f9b9ca
commit 26adbf4416

View file

@ -2480,9 +2480,9 @@ to be called on their own".format(filename, num))
% (filename, i+1, key))
lines[i] = lines[i].replace("=_","=")
if markcheck and value and not value.startswith("$") and not value.startswith("{") and not has_tr_mark and not ("wmllint: ignore" in comment or "wmllint: noconvert" in comment):
# [image] sometimes uses label to specify a reference to a PNG file
# [image] sometimes uses label to specify a reference to a PNG or WebP file
# so do not mark for translation in those cases
if not (key == 'label' and '.png' in value):
if not (key == 'label' and ('.png' in value or '.webp' in value)):
print('"%s", line %d: %s needs translation mark' \
% (filename, i+1, key))
lines[i] = lines[i].replace('=', "=_ ", 1)