Modul:Country alias: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Tidak ada ringkasan suntingan
kTidak ada ringkasan suntingan
 
(54 revisi perantara oleh 8 pengguna tidak ditampilkan)
Baris 4:
--[[
The following country code is used for multiple countries:
ANG (workaround: added ANG_CGF for use with CommonwealthPesta GamesOlahraga Persemakmuran)
 
The following names have different names/flags based on sport/year
Baris 10:
Hong Kong HKG, HKG_CGF (latter added to keep colonial flag)
Individual Olympic Athletes IOA, IOA_2000 (IOA changed to Independent Olympic Athletes in 2012)
Russian Athletes OAR (2018), ROC_2020 (Musim2020 Dingin 2020Summer, Musim2022 Digin 2022Winter)
SWZ Swaziland became Eswatini after the 2018 CommonwealthPesta GamesOlahraga Persemakmuran
MKD Macedonia became North Macedonia in 2019
ART No "Athlete" before Refugee Team @ 2017 AIMAG
D.R. of the Congo Was Zaire (ZAI) and Congo-Kinshasa (COK_COD)
 
The following countries have multiple aliases due to CGF/IOC/FINA/IAAF/etc differences, or deprecated uses
Baris 68 ⟶ 69:
local fullName = stripToNil(args.fullName)
if fullName then
year = tonumber(fullName:match('^%d+$')) -- ignore args.year
end
if alias == 'ANG' then
if games == 'CommonwealthPesta GamesOlahraga Persemakmuran' then
alias = 'ANG_CGF'
end
elseif alias == 'ART' then
if games == 'AsianPesta IndoorOlahraga andDalam MartialRuangan Artsdan GamesBela Diri Asia' then
alias = 'ART_AIMAG'
end
elseif alias == 'GBR' then
if games == 'WorldKejuaraan ChampionshipsDunia in AthleticsAtletik' or games == 'WorldKejuaraan AthleticsAtletik ChampionshipsDunia' or games == 'EuropeanKejuaraan AthleticsEropa ChampionshipsAtletik' then
alias = 'GBR_WCA'
elseif games == 'EuropeanKejuaraan ChampionshipsEropa' then
if year == 2018 then
alias = 'GBR_WCA'
Baris 87 ⟶ 88:
end
elseif alias == 'HKG' then
if games == 'CommonwealthPesta GamesOlahraga Persemakmuran' then
alias = 'HKG_CGF'
end
Baris 102 ⟶ 103:
elseif alias == 'SWZ' then
if fullName then
if year and year >= 2018 and fullName ~= '2018Pesta CommonwealthOlahraga GamesPersemakmuran 2018' then
alias = 'SWZ_YO2018'
end
elseif year and year >= 2018 and games ~= 'CommonwealthPesta GamesOlahraga Persemakmuran' then
alias = 'SWZ_YO2018'
else
Baris 122 ⟶ 123:
elseif alias == 'RUS' then
if year and year==2020 then
if games=='SummerOlimpiade OlympicsMusim Panas' then
alias = 'ROC_2020'
elseif games=='SummerParalimpiade ParalympicsMusim Panas' then
alias = 'RPC'
end
elseif year and year==2022 and games=='Olimpiade Musim Dingin' then
alias = 'ROC_2020'
end
elseif alias == 'ROC' then
if year and year==1960 and games=='Olimpiade Musim Panas' then
alias = 'ROC_Formosa'
elseif year and ( year==1964 or year==1968 ) and games=='Olimpiade Musim Panas' then
alias = 'ROC_Taiwan'
elseif year and year==2020 and games=='Olimpiade Musim Panas' then
alias = 'ROC_2020'
elseif year and year==2022 and games=='Olimpiade Musim Dingin' then
alias = 'ROC_2020'
elseif year and year==2020 and games=='ParalimpikParalimpiade Musim Panas' then
alias = 'RPC'
else
local pageName = mw.title.getCurrentTitle().text
if pageName == 'RussianAtlet OlympicKomite CommitteeOlimpiade athletesRusia pada OlympicsOlimpiade' then
alias = 'ROC_2020'
end
end
elseif alias == 'YUG' or alias == 'SCG' then
if year and year > 1992 and year < 2004 and games ~= 'ParalimpikParalimpiade Musim Panas' then
alias = 'FR_YUG'
end
elseif alias == 'ZAI' or alias == 'COD' then
if year and year < 1971 then
alias = 'COK_COD'
elseif year and year <= 1996 then
alias = 'ZAI'
else
alias = 'COD'
end
elseif alias == 'COK' then
if year and year == 1968 then
alias = 'COK_COD'
else
alias = 'COK'
end
end
Baris 180 ⟶ 195:
end
 
local data = mw.loadData('ModuleModul:Country alias/data')
local function countryAlias(args)
local alias = getAlias(args)
Baris 208 ⟶ 223:
alias = code,
fullName = games,
year = games:match('^%d+$'),
games = games:gsub('^ ?%d+ ?$', ''),
}
local fullName = countryAlias(parms)
Baris 215 ⟶ 230:
local dispName = fullName
if fullName == 'ROC' then
fullName = 'RussianAtlet OlympicKomite CommitteeOlimpiade athletesRusia'
end
return (('[[File:{flag}|22x20px|border|alt=|link=]]&nbsp;[[{name} pada {games}|{dispName}]]{athletes}')
Baris 244 ⟶ 259:
-- Implement [[Template:FlagIOCathlete]].
dispType = 'athlete'
args[3] = 'Olimpiade ' .. (args[3] or '') .. ' Olympics'
end
if dispType == 'name' or dispType == 'team' then
code = stripToNil(args[1]) or error('Parameter 1 shouldharus bemerupakan akode country codenegara')
games = stripToNil(args[2]) or error('Parameter 2 shouldharus bemerupakan anama competition namekompetisi')
athletes = stripToNil(args[3])
elseif dispType == 'athlete' or dispType == 'medalist' then
Baris 259 ⟶ 274:
alias = code,
fullName = games,
year = games:match('^%d+$'),
games = games:gsub('^ ?%d+ ?$', ''),
}
local fullName = countryAlias(parms)