Modul:Country alias: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Tidak ada ringkasan suntingan
k uji coba
Baris 14:
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 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('ˆ^%d+$')) -- ignore args.year
end
if alias == 'ANG' then
if games == 'PestaCommonwealth Olahraga PersemakmuranGames' then
alias = 'ANG_CGF'
end
elseif alias == 'ART' then
if games == 'PestaAsian OlahragaIndoor Dalamand RuanganMartial danArts Bela Diri AsiaGames' then
alias = 'ART_AIMAG'
end
elseif alias == 'GBR' then
if games == 'KejuaraanWorld DuniaChampionships Atletikin Athletics' or games == 'World Athletics Championships' or games == 'KejuaraanEuropean EropaAthletics AtletikChampionships' then
alias = 'GBR_WCA'
elseif games == 'KejuaraanEuropean EropaChampionships' then
if year == 2018 then
alias = 'GBR_WCA'
Baris 88:
end
elseif alias == 'HKG' then
if games == 'PestaCommonwealth Olahraga PersemakmuranGames' then
alias = 'HKG_CGF'
end
Baris 103:
elseif alias == 'SWZ' then
if fullName then
if year and year >= 2018 and fullName ~= 'Pesta2018 OlahragaCommonwealth Persemakmuran 2018Games' then
alias = 'SWZ_YO2018'
end
elseif year and year >= 2018 and games ~= 'PestaCommonwealth Olahraga PersemakmuranGames' then
alias = 'SWZ_YO2018'
else
Baris 123:
elseif alias == 'RUS' then
if year and year==2020 then
if games=='Summer Olympics' then
alias = 'ROC_2020'
elseif games=='MusimSummer PanasParalympics' then
alias = 'RPC'
end
elseif year and year==2022 and games=='Winter Olympics' then
alias = 'ROC_2020'
end
elseif alias == 'ROC' then
if year and year==1960 and games =='MusimSummer PanasOlympics' then
alias = 'ROC_Formosa'
elseif year and ( year==1964 or year==1968 ) and games =='MusimSummer PanasOlympics' ) then
alias = 'ROC_Taiwan'
elseif year and year==2020 and games =='Olimpiade MusimSummer PanasOlympics' then
alias = 'ROC_2020'
elseif year and year==2022 and games == 'Olimpiade MusimWinter DinginOlympics' then
alias = 'ROC_2020'
elseif year and year==2020 and games=='ParalimpiadeSummer Musim PanasParalympics' then
alias = 'RPC'
else
Baris 153 ⟶ 155:
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
return alias
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('ModuleModul:Country alias/data')
local function countryAlias(args)
local alias = getAlias(args)
Baris 216 ⟶ 219:
local games = stripToNil(args[2])
local athletes = stripToNil(args[3])
games = games and ('Olimpiade 'games .. games' Olympics') or 'OlimpiadeOlympics'
local parms = {
alias = code,
fullName = games,
year = games:match('%d+$'),
games = games:gsub(' ?%d+ ?$', ''),
}
local fullName = countryAlias(parms)
Baris 256 ⟶ 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 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=]]&nbsp;[[{name} pada {games}|{dispName}]]<br>{athletes}')
:gsub('{(%w+)}', {
athletes = athletes,