Module:translations: Difference between revisions

m
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
mNo edit summary
mNo edit summary
Line 41: Line 41:
if not title then error("the first parameter provided must be a title for the translations box") end
if not title then error("the first parameter provided must be a title for the translations box") end
table.sort(translations, sort_function)
table.sort(translations, sort_function)
local out = '<div class="mw-collapsible mw-collapsed" data-expandtext="{{int:show}}" data-collapsetext="{{int:hide}}" style="padding:0.2em 0.6em 0.2em 0.6em; border-right:1px solid #BEBEBE; border-bottom:1px dotted black; background:#EDEDED">'
local out = ""
out = out .. "'''" .. title .. "'''"
if #translations > 0 then
out = out .. '\n<div class="z-index:-1; toccolours mw-collapsible-content" style="border:0;">'
out = '<div class="mw-collapsible mw-collapsed" data-expandtext="{{int:show}}" data-collapsetext="{{int:hide}}" style="padding:0.2em 0.6em 0.2em 0.6em; border-right:1px solid #BEBEBE; border-bottom:1px dotted black; background:#EDEDED">'
out = out .. '\n{| border="0" width="100%" class="translations"'
out = out .. "'''" .. title .. "'''"
out = out .. '\n|-'
out = out .. '\n<div class="z-index:-1; toccolours mw-collapsible-content" style="border:0;">'
out = out .. '\n| bgcolor="beige" valign="top" width="48%" |'
out = out .. '\n{| border="0" width="100%" class="translations"'
for _, n in ipairs(translations) do out = out .. '\n* ' .. n.display end
out = out .. '\n|-'
out = out .. '\n|}'
out = out .. '\n| bgcolor="beige" valign="top" width="48%" |'
out = out .. '\n</div></div>[[Category:' .. language.name .. ' terms with translations]]'
for _, n in ipairs(translations) do out = out .. '\n* ' .. n.display .. "[[Category:" .. language.name .. " terms with " .. n.name .. " translations]]" end
out = out .. '\n|}'
out = out .. '\n</div></div>[[Category:' .. language.name .. ' terms with translations]]'
end
for _, lang in ipairs(tag_missing) do
for _, lang in ipairs(tag_missing) do
if lang ~= language.code and args[lang] == nil then
if lang ~= language.code and args[lang] == nil then
out = out .. "[[Category:" .. language.name .. " terms needing " .. m_languages.get_by_code(lang).name .. " translations]]"
out = out .. "[[Category:" .. language.name .. " terms needing " .. m_languages.get_by_code(lang).name .. " translations]]"
end
end
for lang, _ in pairs(args) do
if type(lang) == "string" then
out = out .. "[[Category:" .. language.name .. " terms with " .. m_languages.get_by_code(lang).name .. " translations]]"
end
end
end
end