Content deleted Content added
→Merged: have replaced the module! |
m Replaced deprecated <source> tags with <syntaxhighlight> (via WP:JWB) |
||
(19 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.
<
local countries = {
-- Option 1.
Line 50 ⟶ 58:
},
}
</syntaxhighlight>
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.
<
local countries = {
["ADN"] = {
Line 74 ⟶ 82:
},
}
</syntaxhighlight>
Here is how I think it would work.
Line 111 ⟶ 119:
Surprisingly, there's only one country code that is used for two different countries: ANG is Anguilla via the [[Template:Country flag CGF alias ANG|CGF]] and Angola for the [[Template:Country flag IOC alias ANG|IOC]]. I have absolutely no idea how we could distinguish them. [[User:Primefac|Primefac]] ([[User talk:Primefac|talk]]) 14:00, 8 December 2016 (UTC)
:33 pages transclude the former (CGF) and 363 transclude the latter (IOC). I don't understand the overall picture, but it might turn out that the CGF call can specify a parameter the module could use to select a different entry. Otherwise, we would have to make a fake identifier such as ANG-CGF and change the 33 pages that need it. We can think about that later. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 01:02, 9 December 2016 (UTC)
== It's alive ==
I fixed the code in the module so it should work as discussed. It's been very rushed so quiet checking and testing is needed. Meanwhile, here are some results. The errors in the first four lines are expected because EXZ is not defined and EXX is badly defined.
*<code><nowiki>{{#invoke:Country alias|main|alias=EXZ}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXZ}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXX}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXX}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXX|flag=yes|year=1960}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXX|flag=yes|year=1960}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXX|flag=yes}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXX|flag=yes}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXX|flag=yes|year=1950}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXX|flag=yes|year=1950}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|year=1950}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|year=1950}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|year=1951}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|year=1951}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|year=1952}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|year=1952}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|year=1994}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|year=1994}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|year=1995}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|year=1995}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|year=1996}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|year=1996}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|games=Paralympics}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|games=Paralympics}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|games=Paralympics|year=1952}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|games=Paralympics|year=1952}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|games=Summer Olympics|year=1948}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|games=Summer Olympics|year=1948}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|games=Summer Olympics|year=1949}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|games=Summer Olympics|year=1949}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|games=Summer Olympics|year=1952}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|games=Summer Olympics|year=1952}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|games=Summer Olympics}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|games=Summer Olympics}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|games=Winter Olympics|year=1956}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|games=Winter Olympics|year=1956}}
*<code><nowiki>{{#invoke:Country alias|main|alias=EXA|flag=yes|games=Winter Olympics}}</nowiki></code> → {{#invoke:Country alias|main|alias=EXA|flag=yes|games=Winter Olympics}}
*<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)
|