Модул:Cycling race: Разлика помеѓу преработките

[проверена преработка][проверена преработка]
Избришана содржина Додадена содржина
Нема опис на уредувањето
update
Ред 10:
"Journey origin", "Journey destination", "Teams", "Starting riders", "Arriving riders", "Average speed", "Cost", "Palmares", "Winner", "Second",
"Third", "Points", "Mountains", "Sprints", "Youth", "Combativity", "Combination", "Team"}
l10nDef["//ca.wikipedia.org"] = {"Detalls de la cursa", "Cursa", "COMPETITION", "COMPETITIONS", "Etapes", "Data", "DATES", "Distància", "País", "Països",
"Sortida", "Arribada", "TEAMS", "Inscrits", "Finalitzen", "AVERAGE SPEED", "COST", "Palmarès", "Vencedor", "Segon", "Tercer", "Punts", "Muntanya",
"SPRINTS", "Joves", "Combativitat", "Combinada", "Equip"}
l10nDef["//de.wikipedia.org"] = {"Einzelheiten", "Ausgabe", "Rennserie", " Wettbewerb", "Etappen", "Datum", "AustragungszeitraumDatum", "Gesamtlänge", "Staat", "Staaten",
"Start", "Ziel", "Teams", "Fahrer am Start", "Fahrer im Ziel", "DurchschnittsgeschwindigkeitGeschwindigkeit im Durchschnitt", "Kosten", "Sieger", "Gesamtwertung", "Zweiter",
"Dritter", "Punktewertung", "Bergwertung", "Sprintwertung", "Nachwuchswertung", "Kämpferischster Fahrer", "Kombinationswertung", "Teamwertung"}
l10nDef["//es.wikipedia.org"] = {"Detalles", "Carrera", "Válida para", "Válida para", "Etapas", "Fecha", "Fechas", "Distancia total", "País", "Países",
"Lugar de inicio", "Lugar de llegada", "Equipos", "Ciclistas que iniciaron", "Ciclistas que finalizaron", "Velocidad media", "Costo", "Clasificación final",
"Ganador", "Segundo", "Tercero", "Puntos", "Montaña", "Sprints", "Jóvenes", "Combatividad", "Combinación", "Equipo"}
l10nDef["//mk.wikipedia.org"] = {"Детали за трката", "Издание", "Натпреварување", "Натпреварувања", "Етапи", "Датум", "Датуми", "Растојание",
"Држава", "Држави", "Поаѓалиште", "Одредиште", "Екипи", "Возачи на почеток", "Возачи на крај", "Просечна брзина", "Трошоци", "Добитници на наградите",
"Победник", "Второпласиран", "Третопласиран", "Бодовен", "Планински", "Спринтерски", "Младински", "Борбеност", "Комбиниран", "Екипен"}
l10nDef["//no.wikipedia.org"] = {"Detaljer", "COURSE", "COMPETITION", "COMPETITIONS", "Etapper", "Dato", "DATES", "Distanse", "COUNTRY", "COUNTRIES",
"Startby", "Målby", "TEAMS", "STARTING RIDERS", "ARRIVING RIDERS", "AVERAGE SPEED", "COST", "Resultater", "Vinner", "2. plass", "3. plass",
"Poeng", "Klatre", "Sprint", "Ungdom", "Mest offensive", "Kombinasjon", "Lagkonkurranse"}
l10nDef["//www.wikidata.org"] = l10nDef["//en.wikipedia.org"]
local l10n = l10nDef[mw.site.server]
Ред 27 ⟶ 38:
l10nDef["//en.wikipedia.org"] = {"[[d:Module:Cycling race/doc|Documentation]]", "In Wikidata missing:"}
l10nDef["//de.wikipedia.org"] = {"[[d:Module:Cycling race/doc|Dokumentation]]", "In Wikidata missing:"}
l10nDef["//es.wikipedia.org"] = {"[[d:Module:Cycling race/doc|Documentación]]", "In Wikidata missing:"}
l10nDef["//lb.wikipedia.org"] = {"[[d:Module:Cycling race/doc|Dokumentatioun]]", "In Wikidata missing:"}
l10nDef["//mk.wikipedia.org"] = {"[[d:Module:Cycling race/doc|Документација]]", "In Wikidata missing:"}
Ред 69 ⟶ 81:
local entityId = frame.args[1]
local lang = mw.language.getContentLanguage()
local server = mw.site.server
local results = false
 
Ред 137 ⟶ 150:
a, b = pcall(fooA, 'value', entity, 'P393', 1)
if a == true and t.nr == "" then
if mw.site.server == "//www.wikidata.org" or mw.site.server == "//fr.wikipedia.org" then
if b == 1 then t.nr = "1<sup>re</sup> " else t.nr = b .."<sup>e</sup> " end
else t.nr = b .. "." end
Ред 179 ⟶ 192:
else t.starttime = lang:formatDate( "j.", b )
end
if mwserver == "//fr.sitewikipedia.org" or server == "//frmk.wikipedia.org" then
if y ~= y2 then t.starttime = lang:formatDate( "j F Y", b )
elseif m ~= m2 then t.starttime = lang:formatDate( "j F", b )
else t.starttime = lang:formatDate( "j", b )
end end
if mw.site.server == "//ja.wikipedia.org" then
if y ~= y2 then t.starttime = lang:formatDate( "Y年m月d日", b )
elseif m ~= m2 then t.starttime = lang:formatDate( "Y年m月d日", b )
else t.starttime = lang:formatDate( "Y年m月d日", b )
end end
if mw.site.server == "//en.wikipedia.org" then
if y ~= y2 then t.starttime = lang:formatDate( "F d, Y", b )
elseif m ~= m2 then t.starttime = lang:formatDate( "F d", b )
else t.starttime = lang:formatDate( "F d", b )
end end
if mw.site.server == "//lv.wikipedia.org" then
if y ~= y2 then t.starttime = lang:formatDate( "Y. j. F", b )
elseif m ~= m2 then t.starttime = lang:formatDate( "Y. j. F", b )
Ред 202 ⟶ 215:
if c == true and t.endtime == "" then
t.endtime = lang:formatDate( "j. F Y", d )
if mwserver == "//fr.sitewikipedia.org" or server == "//frmk.wikipedia.org" then
t.endtime = lang:formatDate( "j F Y", d ) end
if mw.site.server == "//ja.wikipedia.org" then
if y ~= y2 then t.endtime = lang:formatDate( "Y年m月d日", d )
elseif m ~= m2 then t.endtime = lang:formatDate( "m月d日", d )
else t.endtime = lang:formatDate( "d日", d )
end end
if mw.site.server == "//en.wikipedia.org" then
if y ~= y2 then t.endtime = lang:formatDate( "F d, Y", d )
elseif m ~= m2 then t.endtime = lang:formatDate( "F d, Y", d )
else t.endtime = lang:formatDate( "d, Y", d )
end end
if mw.site.server == "//lv.wikipedia.org" then
if y ~= y2 then t.endtime = lang:formatDate( "Y. j. F", d )
elseif m ~= m2 then t.endtime = lang:formatDate( "j. F", d )
Ред 224 ⟶ 237:
if a == true and t.time == "" then
t.time = lang:formatDate( "j. F Y", b )
if mwserver == "//fr.sitewikipedia.org" or server == "//frmk.wikipedia.org" then
t.time = lang:formatDate( "j F Y", b ) end
if mw.site.server == "//ja.wikipedia.org" then
t.time = lang:formatDate( "Y年m月d日", b ) end
if mw.site.server == "//en.wikipedia.org" then
t.time = lang:formatDate( "F d, Y", b ) end
if mw.site.server == "//lv.wikipedia.org" then
t.time = lang:formatDate( "Y. j. F", b ) end
end
Ред 240 ⟶ 253:
if b == "http://www.wikidata.org/entity/Q828224" then
t.length_unit = 'km'
if mw.site.server == "//mk.wikipedia.org" then t.length_unit = 'км' end
if mw.site.server == "//ru.wikipedia.org" then t.length_unit = 'км' end
if mw.site.server == "//ja.wikipedia.org" then t.length_unit = 'キロメートル' end
end
end
Ред 284 ⟶ 297:
if b == "http://www.wikidata.org/entity/Q180154" then
t.speed_unit = 'km/h'
if mw.site.server == "//mk.wikipedia.org" then t.length_unitspeed_unit = 'км/ч' end
if mw.site.server == "//ru.wikipedia.org" then t.length_unitspeed_unit = 'км/ч' end
if mw.site.server == "//ja.wikipedia.org" then t.length_unitspeed_unit = 'キロメートル毎時' end
end
end
Ред 305 ⟶ 318:
winner = 'Q'..entity.claims["P1346"][num].qualifiers.P642[1].datavalue.value['numeric-id'] -- Qnumbers of the qualifier
qnumber = entity.claims["P1346"][num].mainsnak.datavalue.value['numeric-id'] -- small "q" to find them in code block below
if mw.site.server == "//fr.wikipedia.org" then qnumber = 'f'..qnumber else qnumber = 'q'..qnumber end -- no WDicon for frWP
if winner == "Q20882667" then t.first = qnumber end
if winner == "Q20882668" then t.second = qnumber end
Ред 420 ⟶ 433:
 
tab = tab .. "<tr><td colspan='2' style='border-bottom:5px solid white; font-size:175%; background:#FFDF80; text-align:center'>"
tab = tab .. "<table style='width:100%'><tr><td>[[File:Wikidata-logo S.svg|30px|link=d:".. frame.args[1] .. "]] </td><td>" .. t.name .."</td><td>" .. t.icon .. "</td></tr></table></td></tr>"
if t.picture ~= "" then tab = tab .. "<tr><td colspan='2' style='text-align:center'>".." [[File:".. t.picture .."|center|300px|".. t.caption .."]]".."</td></tr>" end
tab = tab .. "<tr><td colspan='2' style='background-color:#FFDF80; text-align:center'>'''"..infobox_left(1).."'''</td></tr>"
Ред 459 ⟶ 472:
 
tab = tab.."<tr><td>"..t.previous.."</td><td style='text-align:right'>" .. t.next .. "</td></tr>"
tab = tab .. "<tr><td colspan='2' style='text-align:right; border-top:3px solid #FFDF80; font-size:75%'>" .. infobox_bottom(1)
--tab = tab .. "<span style='float:right' title='".. tooltip .. "'>[[File:High-contrast-help-browser.svg|10px|right|link=]]"
tab = tab .. "</span></td></tr></table>"