FANDOM


--WARFRAME Wiki Faction Language Conversion
--http://warframe.wikia.com/
--Initial wikitext implementation by User:Flaicher
--Lua conversion by User:ChickenBar
 
local p = {}
 
local CharData = mw.loadData( 'Module:FactionScript/data' )
 
function p._corpus( humanwords, size )
    local output_string = {}
    local humanwords = string.lower(humanwords)
    local span = mw.html.create( 'span' )
    if (size == nil or size == '') then size='14' end
    for i=1, string.len(humanwords) do
        local replacement = CharData["CorpusChar"][humanwords:sub(i,i)]
        if replacement ~= nil then
            table.insert(output_string,'[[File:'..replacement..'|x'..size..'px|link=]]')
        else
            table.insert(output_string,'  ')
        end
    end
    span    :css( 'font-size', size..'px' )
            :wikitext( table.concat(output_string) )
    return tostring(span)
end
 
function p.corpus( frame )
    local string_input = frame.args[1]
    local num_input = frame.args[2]
    return p._corpus(string_input, num_input)
end
 
function p._grineer( humanwords, size )
    local output_string = {}
    local humanwords = string.lower(humanwords)
    local replacement = ""
    local replacement_2 = ""
    local span = mw.html.create( 'span' )
    if (size == nil or size == '') then size='16' end
    for i=1, string.len(humanwords) do
        if humanwords:sub(i,i) == "q" then
            replacement = CharData["GrineerChar"]["k"]
            replacement_2 = CharData["GrineerChar"]["w"]
            table.insert(output_string,'[[File:'..replacement..'|x'..size..'px|link=]]'..'[[File:'..replacement_2..'|x'..size..'px|link=]]')
        elseif humanwords:sub(i,i) == "x" then
            replacement = CharData["GrineerChar"]["k"]
            replacement_2 = CharData["GrineerChar"]["s"]
            table.insert(output_string,'[[File:'..replacement..'|x'..size..'px|link=]]'..'[[File:'..replacement_2..'|x'..size..'px|link=]]')
        else
            replacement = CharData["GrineerChar"][humanwords:sub(i,i)]
                if replacement ~= nil then
                    table.insert(output_string,'[[File:'..replacement..'|x'..size..'px|link=]]')
                else
                    table.insert(output_string,' ')
                end
        end
    end
    span    :css( 'font-size', size..'px' )
            :wikitext( table.concat(output_string) )
    return tostring(span)
end
 
function p.grineer( frame )
    local string_input = frame.args[1]
    local num_input = frame.args[2]
    return p._grineer(string_input, num_input)
end
return p
Sauf mention contraire, le contenu de la communauté est disponible sous licence CC-BY-SA  .