Content deleted Content added
No edit summary |
Looking good |
||
Line 27:
::Now I comprend you check for a parameter not definited. I think its cleaner to set the parameter to <code><nowiki>{{{2|}}}</nowiki></code> in the template and check for null string <code>""</code> in the module.--[[User:Moroboshi|Moroboshi]] ([[User talk:Moroboshi|talk]]) 18:01, 22 July 2013 (UTC)
:::The same for <code>{{{link}}}</code> or <code>{{{text}}}</code>, set them to <code><nowiki>{{{link|}}}</nowiki></code> or <code><nowiki>{{{text|}}}</nowiki></code> and check for null string in the module. I uploaded the modified flags to [[Module:Flags/Sandbox]] with some comments about my changes. Apparently it works with the example test in the doc.--[[User:Moroboshi|Moroboshi]] ([[User talk:Moroboshi|talk]]) 18:49, 22 July 2013 (UTC)
::::I had a first look at you version in the sandbox. Looks good, and you are saving almost 20 LOC! But I want to be cautious taking the changes since the template is already transcluded in 600 articles at ca.wiki. Where is git when you need it? ;) I'm starting my holidays tomorrow, flying and then having less time in front of the laptop. Still, I should be able to connect in the evenings. Feel free to "merge" your changes, just trying to do it edit by edit with comments for posterity. Welcome to the team! :)
::::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).
|