跳转到内容

模块:Language/external links

维基百科,自由的百科全书

local getArgs = require("Module:Arguments").getArgs
local getName = require("Module:ISO 639 name").fuzzy

return {
    main = function (frame)
        local args = getArgs(frame)
        local out  = {}

        for k, v in pairs(args) do
            local name = getName{code=v}

            table.insert(
                out,
                tostring(
                    mw.html.create("span")
                        :attr("style", "font-size: 0.95em; font-weight: bold; color: #555")
                        :wikitext("(" .. (name ~= "" and name or v) .. ")")
                )
            )
        end

        return table.concat(out, " ")
    end
}