Documentation for this module may be created at Module:Song versions line/doc
local utils = require('Module:Utilities')
local p = {}
local function formatArg(arg)
if arg and arg ~= '' then
return table.concat(utils.split(arg, "\n"), "<br>")
else
return "<br>"
end
end
function p.main(frame)
local args = frame:getParent().args
local root = mw.html.create('tr')
local categories = ''
root:tag('td'):wikitext(formatArg(args['japanese']))
root:tag('td'):wikitext(formatArg(args['romaji']))
root:tag('td'):wikitext(formatArg(args['english']))
if mw.title.getCurrentTitle().namespace == 0 then
if args['japanese'] and (args['english'] == nil or args['english'] == '') then
categories = "[[Category:Songs with missing English translations]]"
elseif
(args['japanese'] == nil or args['japanese'] == '') and
(args['romaji'] == nil or args['romaji'] == '') and
(args['english'] == nil or args['english'] == '') then
categories = "[[Category:Songs with missing lyrics]]"
end
end
return tostring(root) .. categories
end
return p