Module:TableTranslation
Appearance
local p = {}
function p.render(frame)
local args = frame.args -- used if calling directly with #invoke
local lang1 = args[1]
local lang2 = args[2]
if not lang1 or not lang2 then
return "Error: Two language names must be provided."
end
local output = {}
table.insert(output, "== Translations ==")
-- Start processing from arg #3
for i = 3, #args, 2 do
local text = args[i]
local translation = args[i + 1]
if text and translation then
table.insert(output, string.format("'''%s''': %s → '''%s''': %s", lang1, text, lang2, translation))
end
end
return table.concat(output, "<br>")
end
return p