Make the ignore and noconvert directives work for adding underscores...

...as well as removing them
This commit is contained in:
Alexander van Gessel 2011-02-19 00:41:29 +01:00
parent f20c16c172
commit b7b3d320bf

View file

@ -1262,7 +1262,7 @@ def global_sanity_check(filename, lines):
print '"%s", line %d: %s doesn`t need translation mark (translatable string is empty)' \
% (filename, i+1, key)
lines[i] = lines[i].replace("=_","=")
if markcheck and not value.startswith("$") and not value.startswith("{") and not re.match(" +", value) and not has_tr_mark and lines[i].find("\"\"")==-1:
if markcheck and not value.startswith("$") and not value.startswith("{") and not re.match(" +", value) and not has_tr_mark and lines[i].find("\"\"")==-1 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('=', "=_ ")