Diferència entre revisions de la pàgina «Mòdul:Cycling race»

cap resum d'edició
(update)
local p = {}
flag_table = {}
wiki = string.match(mw.site.server, "%a+")
if wiki == "www" then available, translations = pcall( require, "Module:Cycling race-WD" )
else available, translations = pcall( require, "Module:Cycling race/lang" )
end
 
function victories_translate(wiki,x)
l10nDef["fr"] = {"Date", "Course", "Pays", "Classe", "Vainqueur"}
l10nDef["en"] = {"Date", "Race", "Country", "Class", "Winner"}
l10nDef["da"] = {"Dato", "Løb", "Land", "Klasse", "Vinder"}
l10nDef["no"] = {"Dato", "Løp", "Land", "Klasse", "Vinner"}
local l10n = l10nDef[wiki]
"Classements annexes à l’issue de l’étape", "Points", "Montagne", "Sprints", "Jeune", "Super-combatif", "Combiné", "Étapes volantes", "Régularité",
"Équipe", "Équipe aux points",
"Image", "Légende", "Carte", "Vue en coupe", "Documentation", "Cima Coppi", "Cima Pantani", "Azzurri d'Italia", "Fuga Pinarello"}
l10nDef["en"] = {"Race details", "Race", "Type", "Date", "Dates", "Distance", "Country", "Countries", "Journey origin", "Lieu d'arrivée", "Starting riders",
"Arriving riders", "Average speed", "Cost", "Stage results", "Winner", "Second", "Third", "Combative",
"Secondary classifications after stage", "Points", "Mountain", "Sprints", "Young", "Combativity", "Combinated", "Metas volantes", "Regularity",
"Team", "Team by points",
"Image", "Legend", "Card", "Sectional view", "Documentation", "Cima Coppi", "Cima Pantani", "Azzurri d'Italia", "Fuga Pinarello"}
l10nDef["ca"] = {"Detalls de la cursa", "Cursa", "Tipus", "Data", "Dates", "Distància", "País", "Països", "Origen de la cursa", "Lloc d’arribada", "Corredors sortits",
"Corredors arrivats", "Velocitat mitjana", "Duració", "Resultats de l’etapa", "Guanyador", "Segon", "Tercer", "Combatiu",
"Classificació general després de l'etapa", "Líder", "Segon", "Tercer",
"Classificacions secundàries després de l'etapa ", "Punts", "Muntanya", "Esprints ", "Jove", "Combativitat", "Combinada", "Metes volants", "Regularitat",
"Equip", "Equip per punts",
"Image", "Legend", "Card", "Sectional view", "Documentation", "Cima Coppi", "Cima Pantani", "Azzurri d'Italia", "Fuga Pinarello"}
l10nDef["da"] = {"Etapedetaljer", "Rute", "Type", "Dato", "Datoer", "Distance", "Land", "Lande", "Startby", "Målby", "Startende ryttere",
"Fuldførende ryttere", "Gennemsnitlig fart", "Omkostninger", "Etaperesultat", "Vinder", "Toer", "Treer", "Mest angrebsivrige",
"Klassementerne efter etapen", "Point", "Bjerg", "Sprint", "Ungdom", "Mest angrebsivrige", "Kombination", "Indlagt spurt", "Regularitet",
"Hold", "Hold efter point",
"Billede", "Billedtekst", "Kort", "Profil", "Dokumentation", "Cima Coppi", "Cima Pantani", "Azzurri d'Italia", "Fuga Pinarello"}
l10nDef["no"] = {"Etappedetaljer", "Etappe", "Type", "Dato", "Datoer", "Distanse", "Land", "Land", "Startby", "Målby", "Startende ryttere",
"Fullførende ryttere", "Snittfart", "Omkostninger", "Etapperesultat", "Vinner", "Toer", "Treer", "Mest offensive rytter",
"Klassifisering etter etappen", "Poengtrøye", "Klatretrøye", "Sprinttrøye", "Ungdomstrøye", "Mest offensive rytter", "Kombinasjonstrøye", "Étapes volantes", "Régularité",
"Lagkonkurranse", "Lagkonkurranse etter poeng",
"Bilde", "Bildetekst", "Kart", "Profil", "Dokumentasjon", "Cima Coppi", "Cima Pantani", "Azzurri d'Italia", "Fuga Pinarello"}
l10nDef["pt"] = {"Detalhes da corrida", "Corrida", "Tipo", "Data", "Datas", "Distância", "País", "Países", "Origem da viagem", "Local de chegada", "Partida dos ciclistas",
"Chegada dos ciclistas", "Velocidade média", "Custo", "Resultados da etapa", "Vencedor", "Segundo", "Terceiro", "Combativo",
"Classificação secundária após a etapa", "Pontos", "Montanha", "Corridas de velocidade", "Jovem", "Combatividade", "Combinados", "Metas volantes", "Regularidade",
"Equipe", "Equipe por pontos",
"Imagem", "Legenda", "Ficha", "Vista secional", "Documentação", "Cima Coppi", "Cima Pantani", "Azzurri d'Italia", "Fuga Pinarello"}
 
local l10n = l10nDef[wiki]
function getSquadTableColumn(x)
local l10nDef = { } -- note (in the table), note (below the table)
l10nDef["fr"] = {"Cycliste", "Date de naissance", "Équipe précédente", "note", "note", "Pays"}
l10nDef["en"] = {"Rider", "Date of birth", "Previous team", "note", "note", "Country"}
l10nDef["br"] = {"Reder", "Deiziad genel", "Previous team", "note", "note", "Bro"}
l10nDef["ca"] = {"Ciclista", "Data de naixement", "Equip previ", "Nota", "Nota", "Pais"}
l10nDef["cs"] = {"Cyklista", "Datum narození", "Previous team", "note", "note", "Stát"}
l10nDef["da"] = {"Rytter", "Fødselsdag", "Seneste hold", "note", "note", "Land"}
l10nDef["de"] = {"Name", "Geburtsdatum", "Vorheriges Team", "Anm.", "Anmerkung", "Land"}
l10nDef["eo"] = {"Antaŭnomo Nomo", "Naskiĝtago", "Previous team", "note", "note", "Lando"}
l10nDef["es"] = {"Corredor", "Fecha de nacimiento", "Equipo previo", "Nota", "Nota", "Pais"}
l10nDef["eu"] = {"Izena", "Jaiotze-data", "Previous team", "note", "note", "Herrialde"}
l10nDef["fi"] = {"Ajaja", "Syntymäaika", "Edellinen joukkue", "huomio", "huomio", "Maa"}
l10nDef["fo"] = {"Súkklari", "Føðingardagur", "Previous team", "note", "note", "Country"}
l10nDef["hu"] = {"Név", "Születésnap", "Previous team", "note", "note", "Ország"}
l10nDef["it"] = {"Ciclista", "Data di nascita", "Previous team", "Nota", "Nota", "Paese"}
l10nDef["ja"] = {"選手名", "生年月日", "Previous team", "脚注", "脚注", "国"}
l10nDef["lb"] = {"Coureur", "Gebuertsdatum", "Previous team", "note", "note", "Staat"}
l10nDef["lv"] = {"Braucējs", "Dzimšanas datums", "Iepriekšējā komanda", "piezīme", "piezīme", "Valsts"}
l10nDef["mk"] = {"Велосипедист", "Датум на раѓање", "Previous team", "Фуснота", "Фуснота", "Држава"}
l10nDef["nl"] = {"Naam", "Geboortedatum", "Previous team", "noot", "noot", "Land"}
l10nDef["no"] = {"Rytter", "Fødselsdato", "Tidligere lag", "note", "note", "Stat"}
l10nDef["pl"] = {"Imię i nazwisko", "Data urodzenia", "Previous team", "Przypis", "Przypis", "Państwo"}
l10nDef["pt"] = {"Ciclista", "Data de nascimento", "Equipe anterior", "Nota", "Nota", "Pais"}
l10nDef["ro"] = {"Ciclist", "Data nașterii", "Previous team", "note", "note", "Țară"}
l10nDef["ru"] = {"Гонщик", "Дата рождения", "Предыдущая команда", "Примечание", "Примечание", "Страна"}
l10nDef["sv"] = {"Namn", "Födelsedatum", "Previous team", "not", "not", "Land"}
l10nDef["zh"] = {"車手", "出生日期", "Previous team", "脚注", "脚注", "国家"}
 
local wiki,l10n=mw.site.server
 
a, b = pcall(fooA, 'numeric-id', mw.wikibase.getEntityObject( cont.teamIDs[rank] ), 'P17', 1)
if a == true then cont.country[rank] = mw.wikibase.label( 'Q'..b )
if available == true then
if type( translations ) == "table" then cont.country[rank] = translations.list('Q'..b) end
if cont.country[rank] == '' then
local country = mw.wikibase.getEntityObject( 'Q'..b )
cont.country[rank] = country:getLabel() or country:getLabel('en') .. ' (en)'
end
--else cont.country[rank] = mw.wikibase.label( 'Q'..b ) end
end
else cont.country[rank] = '' end
 
local tableHeader1 = ''
if WDlink_on == false then tableHeader1 = tableHeader1 .. '<span style="float:left">[[File:Wikidata-logo S.svg|12px|link=d:'.. frame.args[1].. '#P2417]]</span>' end
tableHeader1 = tableHeader1 .. headoftableII(wiki,8)
local tableHeader2 = '<tr><th colspan="2" style="text-align:center;padding:2px 2px">'..headoftableII(wiki,3)..
if available==true then tableHeader2 = tableHeader2..'</th><th nowrap style="text-align:center;padding:2px 2px">'..headoftableII(wiki,2).. end
tableHeader2 = tableHeader2..'</th><th style="text-align:center;padding:2px 2px">'..headoftableII(wiki,4)..
'</th><th style="text-align:center;padding:2px 2px">'..headoftableII(wiki,5)..
'</th><th style="text-align:center;padding:2px 2px">'..headoftableII(wiki,6).. '</th></tr>'
 
local tableBody = ''
local i = 1
while cont.nr[i] do
tableBody = tableBody.. '<tr><td nowrap style="text-align:center;padding:2px 0.5em 2px 0.5em">'.. number('f', cont.nr[i], wiki)..
if available==true then tableBody = tableBody..'</td><td style="text-align:left;padding:0 0.2em 0 0.2em">'.. cont.teamNames[i].. '</td>'..
else tableBody = tableBody.. '</td><td style="text-align:left;padding:0 0.2em 0 0.2em">'.. cont.flags[i].. ' '.. cont.countryteamNames[i].. '</td>'..
end
'</td><td style="text-align:right;padding:0 0.2em 0 0.2em">'.. calculate_time(wiki,cont.time[i]).. '</td>'
if available==true then tableBody = tableBody.. '</td><td style="text-align:left;padding:0 0.2em 0 0.2em">'.. cont.flags[i].. ' '.. cont.country[i].. '</td>' end
tableBody = tableBody.. '</td><td style="text-align:right;padding:0 0.2em 0 0.2em">'.. calculate_time(wiki,cont.time[i]).. '</td>'
if i == 1 then tableBody = tableBody.. '</td><td style="text-align:right;padding:0 0.2em 0 0.2em">'.. calculate_time(wiki,cont.time_gap[i]).. '</td>'
else
 
g.riderIDs[rank] = 'Q' .. entity.claims[property][k].mainsnak.datavalue.value['numeric-id']
g.riderNames[rank] = WPlink(g.riderIDs[rank], 'pure')
 
a, b = pcall(fooA, 'numeric-id', mw.wikibase.getEntityObject( g.riderIDs[rank] ), 'P21', 1)
 
a, b = timeStartEnd(g.riderIDs[rank], "P27", 'numeric-id', startOfSeason)
if a == true then
g.flags[rank] = flag('Q'..b, startOfSeason)
if available == true then
-- Add your wiki if you don´t want to see the country names written in the table
if type( translations ) == "table" then g.country[rank] = translations.list('Q'..b) end
if wiki ~= 'www' and wiki ~= 'your wiki' then
localif g.country[rank] = mw.wikibase.getEntityObject(= 'Q'..b )then
g. local country[rank] = country:getLabelmw.wikibase.getEntityObject() or country:getLabel('enQ') ..b ' (en)'
g.country[rank] = country:getLabel() or country:getLabel('en') .. ' (en)'
end
end
end
function p.generalclassification(frame)
local WDlink_on
local wiki = string.match(mw.site.server, "%a+")wiki
frame.args[1] = string.gsub(frame.args[1], "%c", "")
local item = frame.args[1]
local propertycontent = classification(item, 'P2321', wiki)
local content = classification(item, property, wiki)
local time_headoftable = '' -- if there is time data in the classification, print the column time
if content.time_date == true then time_headoftable = headoftableII(wiki,4) end
 
if wiki == "mk" or wiki == "ja" or wiki == "lv" or wiki == "ru" then WDlink_on = true else WDlink_on = false end
local tableHeader1 = ''
if WDlink_on == false then tableHeader1 = tableHeader1 .. '<span style="float:left">[[File:Wikidata-logo S.svg|12px|link=d:'.. frame.args[1].. '#P2321]]</span>' end
tableHeader1 = tableHeader1 .. headoftableII(wiki,9)
local tableHeader2 = '<tr><th colspan="2" nowrap style="text-align:center;padding:2px 2px">'.. headoftableII(wiki,1)
if available==true then tableHeader2 = tableHeader2..'<th colspan="2" nowrap style="text-align:center;padding:2px 2px">'..headoftableII(1wiki,2).. end
tableHeader2 = tableHeader2.. '<th nowrap style="text-align:center">'..headoftableII(2wiki,3)..
'<th nowrap style="text-align:center">'..headoftableII(3)..
'</th><th nowrap style="text-align:center">'..time_headoftable .. '</th></tr>' -- '' or 'temp', depending on available time data
local tableBody = ''
local num = 1 -- loop for more then one jersey per rider
while content.jerseyIDs[i][num] ~= nil do
if content.jerseyIDs[i][num] == "Q24257872" then bg_color="#FF8666" break end -- Jersey red.svg
if content.jerseyIDs[i][num] == "Q24257763" then bg_color="pink" -- Jersey pink.svg
if wiki == "ca" then bg_color="lightpink" end
break end
if content.jerseyIDs[i][num] == "Q24257871" then bg_color="#FFFF99" break end -- Jersey yellow.svg
if content.jerseyIDs[i][num] == "Q26696171" then bg_color="#FFFFFF" break end -- Jersey white.svg
if content.jerseyIDs[i][num] == "Q24687408" then bg_color="#99CBFF" break end -- Jersey blue.svg
if content.jerseyIDs[i][num] == "Q26945272" then bg_color="#BF80FF" break end -- Jersey violet.svg
if content.jerseyIDs[i][num] == "Q24257991" then bg_color="#FFD700" break end -- Jersey gold.svg
if content.jerseyIDs[i][num] == "Q24258056" then bg_color="#FFD030" break end -- Jersey orange.svg
-- if content.jerseyIDs[i][num] == "File:Jersey yellow.svgQ24258125" then bg_color="???#BFFF80" break end -- Jersey yellowgreen 2.svg
-- if content.jerseyIDs[i][num] == "Q24645208" then bg_color="???" end -- Jersey green.svg
if content.jerseyIDs[i][num] == "Q24258125" then bg_color="#BFFF80" end -- Jersey green 2.svg
num = num + 1
end
else tableBody = tableBody ..'"' end
end
if available==true then tableBody = tableBody ..'><td nowrap style="padding:2px 0.5em 2px 0.5em;text-align:center">'.. number(content.riderGender[i], content.nr[i], wiki)..
'</td><td nowrap style="padding:0 0.2em 0 0.2em">'.. content.riderNames[i]
else tableBody = tableBody ..'><td nowrap style="padding:2px 0.5em 2px 0.5em;text-align:center">'.. number(content.riderGender[i], content.nr[i], wiki)..
'</td><td nowrap style="padding:0 0.2em 0 0.2em">'.. content.flags[i]..' '.. content.riderNames[i]
end
if type(content.jersey[i]) == 'table' and content.jersey[i][1] ~= '' then
tableBody = tableBody ..' '
end
 
if available==true then tableBody = tableBody.. '</td><td nowrap style="padding:0 0.2em 0 0.2em;">'.. content.flags[i].. ' '.. content.country[i]..
'</td><td style="padding:0 0.2em 0 0.2em">' .. content.team[i]
else tableBody = tableBody.. '</td><td style="padding:0 0.2em 0 0.2em">' .. content.team[i]
end
 
-- calculate time
function p.stageclassification(frame)
local WDlink_on
local wiki = string.match(mw.site.server, "%a+")wiki
frame.args[1] = string.gsub(frame.args[1], "%c", "")
local item = frame.args[1]
local propertycontent = classification(item, 'P2417', wiki)
local content = classification(item, property, wiki)
local time_headoftable = '' -- if there is time data in the classification, print the column time
if content.time_date == true then time_headoftable = headoftableII(wiki,4) end
 
if wiki == "mk" or wiki == "ja" or wiki == "lv" or wiki == "ru" then WDlink_on = true else WDlink_on = false end
local tableHeader1 = ''
if WDlink_on == false then tableHeader1 = tableHeader1 .. '<span style="float:left">[[File:Wikidata-logo S.svg|12px|link=d:'.. frame.args[1].. '#P2321]]</span>' end
tableHeader1 = tableHeader1 .. headoftableII(wiki,8)
local tableHeader2 = '<tr><th colspan="2" nowrap style="text-align:center;padding:2px 2px">'.. headoftableII(wiki,1)
if available==true then tableHeader2 = tableHeader2..'<th colspan="2" nowrap style="text-align:center;padding:2px 2px">'..headoftableII(1wiki,2).. end
tableHeader2 = tableHeader2.. '<th nowrap style="text-align:center">'..headoftableII(2wiki,3)..
'<th nowrap style="text-align:center">'..headoftableII(3)..
'</th><th nowrap style="text-align:center">'..time_headoftable .. '</th></tr>' -- '' or 'temp', depending on available time data
local tableBody = ''
local tableEnd = '</th></table>'
 
 
local i = 1
tableBody = tableBody .. '<tr'
if i == 1 then tableBody = tableBody ..' style="font-weight:bold;"' end -- winner is formated bold
 
tableBody = tableBody ..'><td nowrap style="padding:2px 0.5em 2px 0.5em;text-align:center">'.. number(content.riderGender[i], content.nr[i], wiki)..
if available==true then tableBody = tableBody ..'><td nowrap style="padding:2px 0.5em 2px 0.5em;text-align:center">'.. number(content.riderGender[i], content.nr[i], wiki)..
'</td><td nowrap style="padding:0 0.2em 0 0.2em">'.. content.riderNames[i]
else tableBody = tableBody ..'><td nowrap style="padding:2px 0.5em 2px 0.5em;text-align:center">'.. number(content.riderGender[i], content.nr[i], wiki)..
'</td><td nowrap style="padding:0 0.2em 0 0.2em">'.. content.flags[i]..' '.. content.riderNames[i]
end
 
if type(content.jersey[i]) == 'table' and content.jersey[i][1] ~= '' then
tableBody = tableBody ..' '
end
 
if available==true then tableBody = tableBody.. '</td><td nowrap style="padding:0 0.2em 0 0.2em;">'.. content.flags[i].. ' '.. content.country[i]..
'</td><td style="padding:0 0.2em 0 0.2em">' .. content.team[i]
else tableBody = tableBody.. '</td><td style="padding:0 0.2em 0 0.2em">' .. content.team[i]
end
 
-- calculate time
if frame.args[1] ~= nil then frame.args[1] = string.gsub(frame.args[1], "%c", "") end
local squadSeason = mw.wikibase.getEntityObject( frame.args[1] )
local flags, pays = {}, {}
local riderIds, riderNames, riderBirthdays, givenname, familyname, riderTeam, time = {}, {}, {}, {}, {}, {}, {}
local riderStart, riderEnd, riderPosition, riderReason, riderRef = {}, {}, {}, {}, {}
local WDlink_on
local team, rider, startOfSeason
--wikilocal v = 'ru'
 
local function trans(date, month, day)
if date ~= '' then
local a,b,c,d = '', '', '', ''
local done = false
mw.log('count=', count)
if count ~= nil then count = count + 1 else count = 1 end
 
if names~='' then _, _, a, b = mw.ustring.find(names, "(%S+)%s+(%S+)") names=b..' '..a..":"..i end
else
-- if givenname ~= '' then mw.log ('Anzahl Vornamen:', givenname) end
-- if familyname ~= '' then mw.log ('Anzahl Nachnamen:', familyname) end
local name_parts_lv = {'da', 'de', 'di', 'De', 'la', 'Le', 'ten', 'van', 'Van'}
local name_parts_mk = {'да', 'ди', 'де', 'Де', 'ла', 'Ле', 'тен', 'ван', 'Ван'}
if wiki == 'mk' or wiki == 'ru' then
if entity:getLabel(language) ~= nil and (mw.ustring.byte(entity:getLabel(language), 1, 1) > 127 and mw.ustring.byte(entity:getLabel(language), 3, 3) > 127)
then riderNames_transl[i] = entity.labels[language].value riderNames_notransl[i] = '' mw.log(i, 'transl 1a ', entity.labels[language].value, mw.ustring.byte(entity:getLabel(language), 3, 3) )
else riderNames_notransl[i] = entity.labels['en'].value or entity.labels['fr'].value or entity.labels['de'].value riderNames_transl[i] = '' mw.log(i, 'notransl 1a ', riderNames_notransl[i])
end
end
if wiki ~= 'mk' and wiki ~= 'ru' then
if entity:getLabel(language) ~= nil then riderNames_transl[i] = entity.labels[language].value riderNames_notransl[i] = '' mw.log(i, 'transl 1b ', entity.labels[language].value, mw.ustring.byte(entity:getLabel(language), 3, 3) )
else riderNames_notransl[i] = entity.labels['en'].value or entity.labels['fr'].value or entity.labels['de'].value riderNames_transl[i] = '' mw.log(i, 'notransl 1b ', riderNames_notransl[i])
end
end
end
if a == true and b ~= nil then
-- mw.log('1', riderNames[i], a, b)
pcall(function()
local v
if pcall(function()
local a, b = timeStartEnd(riderIds[i], "P27", 'numeric-id', startOfSeason)
flags[i] = flag('Q'..b, startOfSeason)
if available==true then
pays[i] = translations.list('Q'..b)
if pays[i] == '' then
local country = mw.wikibase.getEntityObject( 'Q'..b )
pays[i] = country:getLabel() or country:getLabel('en') .. ' (en)'
end
end
end
) then else flags[i] = '' end
name2, _ = mw.ustring.gsub(name1, ":%d+", "")
index[i] = tonumber(number)
-- mw.log(i, number, name2 )
i = i + 1
end
name2, _ = mw.ustring.gsub(name1, ":%d+", "")
index[i] = tonumber(number)
-- mw.log(i, number, name2 )
i = i + 1
end
local tableBody= ''
local tableHeader = '<table border="0" cellspacing="0" cellpadding="2">'
.. '<tr style="background-color:#FFDF80;line-height:1.8em;"><th nowrap style="text-align:left;">'
if WDlink_on == false then tableHeader = tableHeader .. '[[File:Wikidata-logo S.svg|12px|link=d:'.. frame.args[1].. '#P527]]&nbsp;&nbsp;&nbsp;' end
tableHeader = tableHeader..getSquadTableColumn(1)..'</th><th nowrap style="text-align:right">'..getSquadTableColumn(2) ..
if available==true then tableHeader = tableHeader.. '&nbsp;</th><th nowrap style="text-align:left;padding:0 0.5em">'..getSquadTableColumn(36) .. '&nbsp;</th></tr>' end
tableHeader = tableHeader.. '&nbsp;</th><th nowrap style="text-align:left;padding:0 0.5em">'..getSquadTableColumn(3) .. '&nbsp;</th></tr>'
local tableFoot = '</table>'
local tableEndText = ''
i = 1
while index[i] do
tableBody = tableBody.. '<tr style="line-height:1.8em"><td nowrap style="padding:0 1em 0 0">'.. flags[index[i]].. ' '.. riderNames[index[i]]
if available==false then tableBody=tableBody.. flags[index[i]]..' '..riderNames[index[i]] else tableBody = tableBody.. riderNames[index[i]] end
if WDlink_on == true then tableBody = tableBody.. ' '.. wdLink(riderIds[index[i]]) end
if riderStart[index[i]]~='' or riderEnd[index[i]]~='' then
local _, _, y2, m2, d2 = string.find(riderBirthdays[index[i]],"(%d+)-(%d+)-0*(%d+)")
tableBody = tableBody.. frame:expandTemplate{ title = 'Template:Birth date and age2', args = { y1, m1, d1, y2, m2, d2 } }.. '</td>'
else
else tableBody = tableBody.. func_date (riderBirthdays[index[i]], wiki, 'long') ..'</td>' end
if available==false then tableBody=tableBody..'</td>' else tableBody=tableBody..'</td><td>'.. flags[index[i]].. ' '..pays[i].. '</td>' end
end
tableBody = tableBody.. '<td style="padding:0 0.5em; text-align:left">'
if riderTeam[index[i]] ~= nil then tableBody = tableBody.. riderTeam[index[i]].. time[index[i]] end
end
end
if mw.site.server == "//de.wikipedia.org" or mw.site.server == "//da.wikipedia.org" then return a..". "..b.." "..word, "#"..worda..". "..b.." x"..word end
 
-- default
end
 
function headoftableII(wiki,x) -- En-têtes des tableaux générant les classements
local l10nDef = { }
l10nDef["//fr.wikipedia.org"] = {"Coureur", "Pays", "Équipe", "Temps", "Écart de temps", "Vitesse moy.", "Points", "Classement de l'étape", "Classement général", "Classement par points", "Classement de la montagne", "Classement des sprints", "Classement du meilleur jeune", "Classement par équipes"}
l10nDef["//en.wikipedia.org"] = {"Rider", "Country", "Team", "Time", "Time Gap", "Speed", "Points", "Stage classification", "General classification", "Points classification", "Mountains classification", "Sprints classification", "Best young classification", "Teams classifications"}
l10nDef["//br.wikipedia.org"] = {"Reder", "Bro", "Skipailh", "Amzer", "Time Gap", "Speed", "Poentoù", "Renkadur an tennad", "Renkadur hollek", "Renkadur a-boentoù", "Renkadur ar menez", "Renkadur ar sprintoù", "Renkadur ar yaouank gwellañ", "Renkadur a-skipailh"}
l10nDef["//ca.wikipedia.org"] = {"Corredor", "País", "Equip", "Temps", "Time Gap", "Velocitat", "Punts", "Classificació de l'etapa", "Classificació general", "Classificació per punts", "Classificació de la muntanya", "Classificació dels esprints", "Classificació del millor jove", "Classificació per equips"}
l10nDef["//da.wikipedia.org"] = {"Rytter", "Land", "Hold", "Tid", "Tidsforskel", "Gns. fart", "Point", "Etaperesultat", "Samlede stilling", "Pointkonkurrence", "Bjergkonkurrence", "Sprintkonkurrence", "Ungdomskonkurrence", "Holdkonkurrence"}
l10nDef["//de.wikipedia.org"] = {"Fahrer", "Land", "Team", "Zeit", "Zeitabstand", "Geschw.", "Punkte", "Etappenergebnis", "Gesamtwertung", "Punktewertung", "Bergwertung", "Sprintwertung", "Nachwuchswertung", "Mannschaftswertung"}
l10nDef["//eo.wikipedia.org"] = {"Kuranto", "Lando", "Teamo", "Tempo", "Time Gap", "Rapido", "Poentoj", "Etapa klasifiko", "Gxenerala klasifiko", "Klasifiko laux poentoj", "Klasifiko por la montaro", "Klasifiko por la sprintoj", "Klasifiko de la plej bona juno", "Klasifiko po teamo"}
l10nDef["//es.wikipedia.org"] = {"Ciclista", "País", "Equipo", "Tiempo", "Intervalo de tiempo", "Velocidad media", "Puntos", "Clasificación de la etapa", "Clasificación general", "Clasificación por puntos", "Clasificación de la montaña", "Clasificación de los sprints", "Clasificación del mejor joven", "Clasificación por equipos"}
l10nDef["//eu.wikipedia.org"] = {"Txirrindularia", "Herrialdea", "Taldea", "Denbora", "Time Gap", "Speed", "Puntua", "Etapako sailkapena", "Sailkapen orokorra", "Puntukako sailkapena", "Mendiko sailkapena", "Esprinetako sailkapena", "Gazte onenaren sailkapena", "Taldekako sailkapena"}
l10nDef["//fi.wikipedia.org"] = {"Pyöräilijä", "Maa", "Joukkue", "Aika", "Aikaero", "Nopeus", "Pisteet", "Etapin tulokset", "Kokonaistilanne", "Pistekilpailu", "Vuoristokilpailu", "Sprinttikilpailu", "Nuorten kilpailu", "Joukkuekilpailu"}
l10nDef["//fo.wikipedia.org"] = {"Súkklari", "Land", "Lið", "Tíð", "Time Gap", "Ferð", "Stig", "Teinaplasering", "Samlað plasering", "Stigkappingin", "Fjallakappingin", "Spurtkappingin", "Ungdómskappingin", "Liðkappingin"}
l10nDef["//lb.wikipedia.org"] = {"Coureur", "Land", "Equipe", "Zäit", "Time Gap", "Vitesse", "Punkten", "Etappeklassement", "Generalklassement", "Klassement no Punkten", "Biergpräis", "Sprintklassement", "Beschte Jonken", "Equippeklassement"}
l10nDef["//no.wikipedia.org"] = {"Rytter", "Land", "Lag", "Tid", "Tidsforskjell", "Fart", "Poeng", "Etappeplassering", "Sammenlagtplassering", "Poengkonkurranse", "Klatrekonkurranse", "Sprintkonkurranse", "Ungdomskonkurranse", "Lagkonkurranse"}
l10nDef["//nl.wikipedia.org"] = {"Renner", "Land", "Ploeg", "Tijd", "Tijdsverschil", "Snelheid", "Punten", "Etappeklassement", "Algemeen Klassement", "Puntenklassement", "Bergklassement", "Sprintklassement", "Jongerenklassement", "Ploegenklassement"}
l10nDef["//pt.wikipedia.org"] = {"Ciclista", "País", "Equipe", "Tempo", "Intervalo de tempo", "Rapidez", "Pontos", "Classificação por etapas", "Classificação geral", "Classificação por pontos", "Classificação de montanha", "Classificação por velocidade", "Classificação de juventude", "Classificação coletiva"}
l10nDef["//ro.wikipedia.org"] = {"Ciclist", "Țară", "Echipă", "Timp", "Time Gap", "Viteză", "Puncte", "Clasamentul etapei", "Clasament general", "Clasament pe puncte", "Clasament cățărători", "Clasament sprinteri", "Clasamentul celui mai bun tânăr", "Clasament pe echipe"}
l10nDef["//ru.wikipedia.org"] = {"Гонщик", "Страна", "Команда", "Время", "Отставание", "Скорость", "Очки", "Результаты этапа", "Генеральная классификация", "Очковая классификация", "Горная классификация", "Спринтерская классификация", "Молодёжная классификация", "Командная классификация"}
l10nDef["//www.wikidata.org"] = l10nDef["//fr.wikipedia.org"]
local l10n = l10nDef[mw.site.server]
if not l10n thenlocal l10n = l10nDef["//fr.wikipedia.org"wiki] end -- default
if not l10n then l10n = l10nDef["en"] end -- default
return l10n[x]
end
 
if flag1[x]~=nil then return flag1[x] end
 
local flag2 = { Q16={'Q80110','CAN'}, Q17={'Q43175','JPN'}, Q20={'Q83149','NOR'}, Q27={'Q82205','IRL'}, Q35Q32={'Q60149Q133022','DENLUX'}, Q36Q33={'Q42436Q47891','POLFIN'},
Q37Q34={'Q81477Q81286','LTUSWE'}, Q39Q35={'Q124020Q60149','SUIDEN'}, Q77Q36={'Q171103Q42436','URUPOL'}, Q145Q37={'Q83278Q81477','GBRLTU'}, Q159Q39={'Q16611Q124020','RUSSUI'}, Q191Q77={'Q81471Q171103','ESTURU'}, Q211={'Q130449','LAT'},
Q212Q96={'Q127974Q122462','UKRMEX'}, Q214Q145={'Q160861Q83278','SVKGBR'}, Q232Q159={'Q131650Q16611','KAZRUS'}, Q262Q191={'Q83392Q81471','DZAEST'}, Q408Q211={'Q81676Q130449','AUSLAT'}, Q739Q212={'Q160425Q127974','COLUKR'}, }
Q213={'Q127155','CZE'}, Q214={'Q160861','SVK'}, Q232={'Q131650','KAZ'}, Q262={'Q83392','DZA'}, Q408={'Q81676','AUS'}, Q414={'Q130774','ARG'},
Q664={'Q160260','NZL'}, Q717={'Q165538','VEN'}, Q739={'Q160425','COL'} }
 
local xx