Module talk:Country alias: Difference between revisions

Content deleted Content added
It's alive: new section
m Replaced deprecated <source> tags with <syntaxhighlight> (via WP:JWB)
 
(18 intermediate revisions by 5 users not shown)
Line 1:
#REDIRECT [[Template talk:Country alias]]
 
{{Rcat shell|
{{R from remote talk page}}
}}
Putting a redirect here so that non-technical discussions about this module can take place at the template that calls it.
{{split article|from=Module talk:Country alias|to=Template talk:Country alias|date=15 January 2017|from_oldid=760120444|diff=760120590}}
 
==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.
Line 25 ⟶ 33:
 
Perhaps something like the following would work, taking PUR as an example.
<sourcesyntaxhighlight lang="Lua">
local countries = {
-- Option 1.
Line 50 ⟶ 58:
},
}
</syntaxhighlight>
</source>
I need to know what inputs would cause "1948 Summer Olympics" and similar entries to be used. I don't understand what the idea is there. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 10:25, 8 December 2016 (UTC)
:Option 2 is far superior, mostly because it would mean not having to combine "year" and "games". It would also mean Chinese Taipei would be easier to code (it has a different flag depending on which games they're playing). As far as what's actually calling this module: most would be from {{t|infobox country at games}}, which requires year, games, and country code. [[User:Primefac|Primefac]] ([[User talk:Primefac|talk]]) 13:02, 8 December 2016 (UTC)
Line 56 ⟶ 64:
===Format 2===
I'm now thinking of using the following format. The following shows a simple case and a more complex example based on PUR. There is no need to use 3000 as a special code.
<sourcesyntaxhighlight lang="Lua">
local countries = {
["ADN"] = {
Line 74 ⟶ 82:
},
}
</syntaxhighlight>
</source>
 
Here is how I think it would work.
Line 138 ⟶ 146:
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|games=Bogus Olympics|year=1956}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|games=Bogus Olympics|year=1956}}
Please check the above and run some other tests. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 09:49, 9 December 2016 (UTC)
:Should the module insert prefix "File:" before the flag text? [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 10:18, 9 December 2016 (UTC)
::No, it should not insert the prefix. While it would be fine in some usage (like {{t|flagIPC}}), infoboxes invoke [[Module:InfoboxImage|InfoboxImage]], which requires only the name. [[User:Primefac|Primefac]] ([[User talk:Primefac|talk]]) 17:50, 9 December 2016 (UTC)
 
== flagIOC2 ==
 
{{ping|Primefac}} See [https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmprop=title&cmlimit=500&cmnamespace=0&format=xml&cmtitle=Category:Pages_with_script_errors articles with script errors] for articles in [[:Category:Pages with script errors]]. I don't have time to investigate further at the moment but the problem seems to be that the original flagIOC in [[Module:Country alias]] had the following line:
<pre>
games = games and (games .. ' Olympics') or 'Olympics'
</pre>
but there is no equivalent in flagIOC2. That line sets a default of 'Olympics' if the games parameter is not set. I don't know if the articles in the error category actually should have a games parameter or whether a default should be applied in the module. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 09:34, 2 December 2019 (UTC)
:I've added a {{para|games|<nowiki>{{{2|{{PAGENAME}}}}}</nowiki>}} to {{t|FlagIOC2}}, much the same as it's set up in {{t|country alias}} itself, but it doesn't seem to be fixing the error. It ''should'' just take the pagename if none is given, but given the relatively small number of pages this is affecting I don't mind terribly if that default isn't possible. [[User:Primefac|Primefac]] ([[User talk:Primefac|talk]]) 10:56, 2 December 2019 (UTC)
::It looks like a purge was all that was needed as there are no articles in the error category now. I could move that default into the module but it's ok in the template. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 21:41, 2 December 2019 (UTC)