Module talk:Flags: Difference between revisions

Content deleted Content added
Line 30:
::::Just curious: why are you changing the sequence of the script? It makes comparing code a bit more difficult. I had the idea of going for 1 Name; 2 Variant; 3 Size; 4 Link; 5 Label - but if there are good reasons to change it I'm all ears.
::::I had trouble with other approaches for <code>{{{link}}}</code> or <code>{{{text}}}</code>. Null string is actually different from no parameter defined. Users can set <nowiki>link=</nowiki> or <nowiki>text=</nowiki> to give specific instructions to the template (no link and same label as name of flag).
:::::I think the only thing I moved out of order was the function default_size (and obviously check_translation that is new), i assigned the name flag_code to territory.args[1] because is used in different points of the script (but maybe the name could be more specific).
::::Regarding the use of parameter do you known that you can have a simpler template call like <code>{{Invoke|Flags|flag}}</code> and access the parameter in lua module using <code>territory:parent().args()</code> ? Is sufficient to add this code to the start of the function:
<syntaxhighlight lang="lua">
function p.flag(territory)