wmllint: add "unknown speaker" warning

I actually thought this was already checked by the "unknown 'xx' referred to
by id" warning. Probably because many more [message]s used to use id= and
role= rather than speaker=.

As a side effect, this new error will force designers to use my 'who' and
'whofield' magic comments!
This commit is contained in:
Groggy Dice 2013-12-27 10:18:30 -05:00
parent 82862d11bd
commit 9689cd0d0b

View file

@ -1594,6 +1594,10 @@ def global_sanity_check(filename, lines):
if ids[j].lstrip() not in present and not in_clear_menu_item:
print '"%s", line %d: unknown \'%s\' referred to by id' \
% (filename, i+1, ids[j])
if (in_scenario or in_multiplayer) and key == "speaker":
if value not in present and value not in ("narrator", "unit", "second_unit") and value[0] not in ("$", "{"):
print '"%s", line %d: unknown speaker \'%s\' in message' \
% (filename, i+1, value)
if markcheck and has_tr_mark and not ("wmllint: ignore" in comment or "wmllint: noconvert" in comment):
print '"%s", line %d: %s should not have a translation mark' \
% (filename, i+1, key)