Content deleted Content added
←Created page with '==Getting this module started== I'm going to start this discussion here rather than on any user talk pages mostly for a central discussion to take place. There...' |
→Getting this module started: need details |
||
Line 5:
This module takes the three-letter country code, the year, and the games being played and returns either the full name of the country or the flag associated with that country. The "year" and "games" are used to project the correct flag depending on the situation. {{u|Johnuniq}}, this is where I need a bit of help, because while I am pretty good with most programming languages, I'm still getting a handle on scribunto and I'm not quite sure how to make the above happen properly. I've tried to model it off of [[Module:Team appearances list]] but the order of the syntax is getting me twisted. I'd rather this get implemented sooner rather than later, hence the appeal for assistance. Let me know if a) you're willing to help, b) if I can answer any questions, c) what sort of whisky you drink because you've put in a ton of work on our mutual projects and deserve some ;) [[User:Primefac|Primefac]] ([[User talk:Primefac|talk]]) 03:13, 8 December 2016 (UTC)
:I'm happy to do whatever is wanted. I have not got my head around the situation yet, but my first observation is that it would be better to integrate the <code>fullName</code> and <code>fullFlag</code> tables into one table called <code>countries</code> or <code>aliases</code> or <code>data</code> or whatever. That may look ugly but it is always better to keep related information in one place, when possible. That avoids duplication and errors due to typos ("ALG" in one place and "AGL" in another). I can do mega-edits and am happy to integrate them if we agree that is desirable.
:In fullFlag, I assume 3000 is a sentinel to mark the end of the list. Taking AHO as an example, if parameter year is 1982 or earlier, the flag is the first item; or if year is 1983–2010 inclusive, it is the second; otherwise, it's the third.
:Looking at AUS, if parameter games is "1980 Summer Olympics", the flag is the last item and year is ignored. Otherwise, the flag is the first or second or third item, depending on whether year is <=1900 or 1901–1909 or >1909. What happens if games is "1980 Summer Olympic" (a typo with no "s")? Is that ignored, or is it an error? Having an error is probably better to force clean usage.
:I do not see why games is needed. Why not simply provide year, and make it return the Olympics flag if year is 1980? For AUS, would the Olympics flag ever be wanted with a year that was not 1980? Perhaps "Flag of Australia.svg" is sometimes wanted for 1980 but "Olympic flag.svg" is wanted for 1980 in another context. To achieve that, <code>games</code> could be "yes" to select the Olympic flag if year is 1980.
:The inputs to the module (parameters) are:
:*alias (country code; error if missing or invalid)
:*flag ('yes' returns flag name; otherwise returns country name)
:*year (used to determine which flag, possibly in conjunction with games)
:*games (used to determine which flag)
:Is that all correct? If so, I'll muck around with it and am likely to do something withing 24 hours. Anything else? [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 04:09, 8 December 2016 (UTC)
|