Module:labels: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 1: Line 1:
local export = {}
local export = {}


function export.make_labels(language, labels, nocat, nobrackets)
function export.make_labels(language, labels, nocat, nobrackets, noitalics)
local function make_label(label_id, label, language_name)
local function make_label(label_id, label, language_name)
local categories = label["categories"]
local categories = label["categories"]
Line 24: Line 24:
end
end
local l_data = mw.loadData("Module:labels/data")
local l_data = mw.loadData("Module:labels/data")
local out = nobrackets and "<i>" or "(<i>"
local out = (nobrackets and "" or "(") .. (noitalics and "" or "<i>")
local cats = ""
local cats = ""
local skip_comma = false
local skip_comma = false
Line 94: Line 94:
end
end
end
end
out = out .. (nobrackets and "</i>" or "</i>)")
out = out .. (noitalics and "" or "</i>") .. (nobrackets and "" or ")")
return out .. (nocat and "" or cats)
return out .. (nocat and "" or cats)
end
end