10,735
edits
No edit summary |
TheNightAvl (talk | contribs) (Added with +link functionality... hopefully) |
||
Line 24: | Line 24: | ||
end | end | ||
local l_data = mw.loadData("Module:labels/data") | local l_data = mw.loadData("Module:labels/data") | ||
local out = "( | local out = "(<i>" | ||
local cats = "" | local cats = "" | ||
local skip_comma = false | local skip_comma = false | ||
Line 31: | Line 31: | ||
local label = l_data.labels[l_id] | local label = l_data.labels[l_id] | ||
if i > 1 then | if i > 1 then | ||
local conjunctions = {"with", "and", "or"} | |||
if conjunctions[labels[i]] or conjunctions[labels[i+1]] then | |||
skip_comma = true | |||
end | |||
out = out .. (skip_comma and " " or ", ") | out = out .. (skip_comma and " " or ", ") | ||
end | end | ||
if label == null then | if label == null then | ||
out = out .. l_id | if mw.ustring.find(l_id, "^%[.+%]$") then | ||
local l_id_link = mw.ustring.gmatch(l_id, "^%[(.+)%]$") | |||
out = out .. "</i>[[" .. l_id_link .. "#" .. language.name .. "|" .. l_id_link .. "]]<i>" | |||
else | |||
out = out .. l_id | |||
end | |||
skip_comma = false | skip_comma = false | ||
else | else | ||
Line 43: | Line 52: | ||
end | end | ||
end | end | ||
out = out .. " | out = out .. "</i>)" | ||
return out .. (nocat and "" or cats) | return out .. (nocat and "" or cats) | ||
end | end |