FANDOM


local infobox = {}
 
local types = {
    ["노말"] = "normal",
    ["불꽃"] = "fire",
    ["물"] = "water",
    ["전기"] = "electric",
    ["풀"] = "grass",
    ["얼음"] = "ice",
    ["격투"] = "fighting",
    ["독"] = "poison",
    ["땅"] = "ground",
    ["비행"] = "flying",
    ["에스퍼"] = "psychic",
    ["벌레"] = "bug",
    ["바위"] = "rock",
    ["고스트"] = "ghost",
    ["드래곤"] = "dragon",
    ["악"] = "dark",
    ["강철"] = "steel",
    ["페어리"] = "fairy",
    ["???"] = "unknown"
}
 
local function translateType( str )
    return types[str] or ""
end
 
function infobox.theme( frame )
    return " theme=\"" .. frame.args[1] .. frame.args[2] .. "\""
end
 
function infobox.formatDate( frame )
    local tbl = {}
    local suffix = { "년", "월", "일" }
 
    for i = 1, 3 do
        if frame.args[i] then
            table.insert( tbl, frame.args[i] .. suffix[i] )
        end
    end
 
    return table.concat( tbl, " " )
end
 
function infobox.navigation( frame )
    local name = frame.args[1]
    local index = navigationMap[ name ][ "index" ]
    local container = mw.html.create( "div" )
 
    container:addClass( "pi-navigation--gallery group " .. navigationMap[ name ][ "id" ] )
 
    for i = 1, #index do
        container:wikitext( "[[" .. name .. "/" .. index[i] .. "|<span>" .. index[i] .. "</span>]]" )
        if i ~= #index then
            container:wikitext( "&nbsp;·&nbsp;" );
        end
    end
 
    return container
end
 
return infobox