Modul:Country alias: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
Tidak ada ringkasan suntingan |
kTidak ada ringkasan suntingan |
||
(2 revisi perantara oleh pengguna yang sama tidak ditampilkan) | |||
Baris 4:
--[[
The following country code is used for multiple countries:
ANG (workaround: added ANG_CGF for use with
The following names have different names/flags based on sport/year
Baris 11:
Individual Olympic Athletes IOA, IOA_2000 (IOA changed to Independent Olympic Athletes in 2012)
Russian Athletes OAR (2018), ROC_2020 (2020 Summer, 2022 Winter)
SWZ Swaziland became Eswatini after the 2018
MKD Macedonia became North Macedonia in 2019
ART No "Athlete" before Refugee Team @ 2017 AIMAG
D.R. of the Congo
The following countries have multiple aliases due to CGF/IOC/FINA/IAAF/etc differences, or deprecated uses
Baris 65:
-- Return alias parameter, possibly modified for exceptional cases.
local alias = stripToNil(args.alias)
local year = tonumber(args.year)▼
local games = stripToNil(args.games)
▲ local year = tonumber(args.year)
local fullName = stripToNil(args.fullName)
if fullName then
year = tonumber(fullName:match('
end
if alias == 'ANG' then
Baris 80:
end
elseif alias == 'GBR' then
if games == 'Kejuaraan Dunia Atletik' or games == 'Kejuaraan Atletik Dunia' or games == 'Kejuaraan Eropa Atletik' then
alias = 'GBR_WCA'
elseif games == 'Kejuaraan Eropa' then
Baris 123:
elseif alias == 'RUS' then
if year and year==2020 then
if games=='Olimpiade Musim Panas' then
alias = 'ROC_2020'
elseif games=='Paralimpiade Musim Panas' then
alias = 'RPC'
end
end
elseif alias == 'ROC' then
if year and year==1960 and games
alias = 'ROC_Formosa'
elseif year and ( year==1964 or year==1968 ) and games
alias = 'ROC_Taiwan'
elseif year and year==2020 and games
alias = 'ROC_2020'
elseif year and year==2022 and games
alias = 'ROC_2020'
elseif year and year==2020 and games=='Paralimpiade Musim Panas' then
Baris 153 ⟶ 155:
if year and year < 1971 then
alias = 'COK_COD'
alias = 'ZAI'
end
end
local function getFlag(args, country)
-- Return name of flag selected from country data (nil if none defined).
Baris 192 ⟶ 195:
end
local data = mw.loadData('
local function countryAlias(args)
local alias = getAlias(args)
Baris 220 ⟶ 223:
alias = code,
fullName = games,
year = games:match('%d+$'),
games = games:gsub(' ?%d+
}
local fullName = countryAlias(parms)
Baris 259 ⟶ 262:
end
if dispType == 'name' or dispType == 'team' then
code = stripToNil(args[1]) or error('Parameter 1
games = stripToNil(args[2]) or error('Parameter 2
athletes = stripToNil(args[3])
elseif dispType == 'athlete' or dispType == 'medalist' then
Baris 271 ⟶ 274:
alias = code,
fullName = games,
year = games:match('%d+$'),
games = games:gsub(' ?%d+
}
local fullName = countryAlias(parms)
Baris 313 ⟶ 316:
}))
elseif dispType == 'medalist' then
return (('{athletes}<br>[[File:{flag}|23x15px|border|alt=|link=]] [[{name} pada {games}|{dispName}]]
:gsub('{(%w+)}', {
athletes = athletes,
|