Modul:Goalscorers: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Tidak ada ringkasan suntingan
Tidak ada ringkasan suntingan
Baris 782:
--getArgs(frame)
--[[ {{{#if:{{{assists|}}}||ThereSebanyak {{{goals}}}
{{#if:{{{ongoing|}}}| {{#ifexpr:{{{goals}}}=1|hasgol|havegol}} beentelah dicetak
| {{#ifexprif:{{{goalsplayers|}}}=1|was|were}}}} oleh {{{goalsplayers}}}
{{#ifexpr:{{{goalsplayers}}}=1|goalpemain|goals}}pemain scored{{#if:{{{players|}}}| byyang {{{playersberbeda}}}
{{#if:{{{own_goals|}}}| (dengan {{{own_goals}}} gol di antaranya termasuk ke dalam
{{#ifexpr:{{{players}}}=1|player|different players}}
{{#if:{{{own goals|}}}| (with {{{own goals}}} of them credited as {{#ifexpr:{{{own goalsown_goals}}}=1|angol ownbunuh goaldiri|owngol bunuh goalsdiri}})|}}|}} inpada {{{matches}}}
{{#ifexpr:{{{matches}}}=1|matchpertandingan|matchespertandingan}}, fordengan an average of {{#expr:{{{goals}}}/{{{matches}}} round 2}}rata-rata
{{formatnum: {{#expr:{{{goals}}}/{{{matches}}} round 2}}}} {{formatnum:{{#ifexpr:({{{goals}}}/{{{matches}}} round 2)=1|goalgol|goalsgol}}}} per matchpertandingan.}}
{{#if:{{{updated|}}}| (as of {{{updated}}})}}.}} {{#if:{{{bold|}}}|{{#if:{{{assists|}}}|| }}Pemain bercetak '''tebal''' masih bermain pada turnamen ini.|}}
{{#if:{{{further|}}}|{{#if:{{{assists|}}}|| }}{{{further}}}|}}
Players highlighted in '''bold''' are still active in the competition.
|}} {{#if:{{{furtherextra|}}}|{{#if:{{{assists|extra}}}|| }}{{{further}clear}}|}}
{{#if:{{{extra|}}}|{{{extra}}}{{clear}}|}}
--]]
local statNumber = g.args['goals'] or g.args['assists'] or 0
local matches = g.args['matches']
local statType = "goalgol"
if g.args['assists'] then statType = "assistumpan gol" end
if g.args['clean sheets'] then statType = "clean sheetnirbobol" end
local ongoing = g.args['ongoing']
local text1 = "ThereSebanyak"
if g.args['lc'] then text1 = "there" end
local text2 = "were"
if ongoing then text2 = "have been" end
local updateString = ""
local averageString = ""
local goalPlural = "s" -- goal(s)
if g.args['goals'] and tonumber(g.args['goals']) == 1 then
goalPlural = ""
text2 = "was"
if ongoing then text2 = "has been" end
end
local matchPlural = "es" -- match(es)
if g.args['matches'] and tonumber(g.args['matches']) == 1 then matchPlural = "" end
-- auto version: string.format(" in %d match%s, for an average of %."..precision.."g goal%s per match", matches, pluralMatches, average, pluralAverage)
if g.args['goals'] and g.args['matches'] then
local averageGoals = g.args['goals']/g.args['matches']
averageString = string.format(" inpada %d match%s, fordengan an average ofrata-rata %.3g goal%s per matchpertandingan", g.args['matches'], matchPlural, averageGoals, avGoalPlural)
local avGoalPlural = "s"
if averageGoals == 1 then avGoalPlural = "" end
averageString = string.format(" in %d match%s, for an average of %.3g goal%s per match", g.args['matches'], matchPlural, averageGoals, avGoalPlural)
end
if g.args['updated'] and g.args['updated'] ~= "complete" then
updateString = " (as ofper " ..g.args['updated'] .. ")"
end
local septitik = "."
if g.args['sep'] then sep = g.args['sep'] end
local text = ""
if g.args['goals'] then
text = string.format("%s %s %d %s%s scored%sdicetak",
text1, text2, statNumber, statType, goalPlural, averageString..updateString..septitik)
end
text = p.addAdditionHeaderText(text) -- handles template parameters bold, further, extra
Baris 852 ⟶ 836:
if number < 0 then
entry = g.args[math.abs(number) .. ' own goals'] or g.args[math.abs(number) .. ' own goal']
statType = "owngol goalbunuh diri"
end
local plural = "s"
Baris 867 ⟶ 851:
end
if statType == "goalgol" or statType == "owngol goalbunuh diri" then
if g.args['goals'] and totalGoals ~= tonumber(g.args['goals']) then
mw.addWarning("WARNINGPERINGATAN. Mismatch between number of goals listed (" .. totalGoals .. ") and goals parameter (" .. g.args['goals'] .. ").")
end
end
Baris 888 ⟶ 872:
--{{#if:{{{source|}}}|{{small|Source: {{{source}}}}}|}}
local source = g.args['source'] or ""
if source ~= "" then source = "<small>SourceSumber: " .. source .. "</small>" end
return text .. output .. footer .. source