wmllint: Ignore labels for translation if a PNG extension is found (#7079)
* wmllint: Ignore labels for translation if a PNG extension is found.
Resolves #6995.
(cherry picked from commit 2010ffdbba
)
This commit is contained in:
parent
74e2ac7e94
commit
495433fae8
1 changed files with 6 additions and 3 deletions
|
@ -2175,9 +2175,12 @@ 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 re.match(" +", value) and not has_tr_mark and not ("wmllint: ignore" in comment or "wmllint: noconvert" in comment):
|
||||
print('"%s", line %d: %s needs translation mark' \
|
||||
% (filename, i+1, key))
|
||||
lines[i] = lines[i].replace('=', "=_ ", 1)
|
||||
# [image] sometimes uses label to specify a reference to a PNG file
|
||||
# so do not mark for translation in those cases
|
||||
if not (key == 'label' and '.png' in value):
|
||||
print('"%s", line %d: %s needs translation mark' \
|
||||
% (filename, i+1, key))
|
||||
lines[i] = lines[i].replace('=', "=_ ", 1)
|
||||
nv = sentence_end.sub(" ", value)
|
||||
if nv != value:
|
||||
print('"%s", line %d: double space after sentence end' \
|
||||
|
|
Loading…
Add table
Reference in a new issue