Improve empty value checks
This commit is contained in:
parent
ef2205aa62
commit
e8e5387069
1 changed files with 2 additions and 2 deletions
|
@ -2246,11 +2246,11 @@ to be called on their own".format(filename, num))
|
|||
print('"%s", line %d: %s should be renamed as variation_id and/or marked as translatable' \
|
||||
% (filename, i+1, key))
|
||||
elif is_translatable(key):
|
||||
if markcheck and has_tr_mark and '""' in lines[i]:
|
||||
if markcheck and has_tr_mark and not value:
|
||||
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 '""' not in lines[i] and not ("wmllint: ignore" in comment or "wmllint: noconvert" in comment):
|
||||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue