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:
parent
82862d11bd
commit
9689cd0d0b
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue