BFDI Wiki JP
Advertisement

このモジュールについての説明文ページを モジュール:Language/doc に作成できます

local lng = {}
local new_args = {}
 
function lng.sort( frame )
    local allln = {'en','es','ens',
        'de','fr','he','hr','is','it','kl','ro','vi','zh','af'};
    local otherln = {
        'de','fr','he','hr','is','it','kl','ro','vi','zh','af'};
    lng._getParameters(frame.args,allln); 
    local en = new_args['en'];
    local es = new_args['es'];
    local ens = new_args['ens'];
    local count = 0
 
    local result = "{{Language";
 
    if ens ~= nil and ens~='' then
        result = result .. "|ens=" .. ens;
    elseif en ~= nil and en~='' and en == es  then
        result = result .. "|ens=" .. en;
    else
        if en ~= nil and en~='' then
            result = result .. "|en=" .. en;
        end
        if es ~= nil and es~='' then
            result = result .. "|es=" .. es;
        end
    end
    local rrsl = result;
 
    for i, v in ipairs(otherln) do
        count = count+1 
        result = result .. lng.set(v,new_args[v])
    end
 
    result = result .. "}}";
 
    return result
end
 
function lng.set(lng,v)
    if v~=nil and v~='' then
        return "|" .. lng .. '=' .. v;
    end
    return '';
end
 
function lng._getParameters( fa,al )
    local value;
 
    for i,arg in ipairs( al ) do
        value = fa[arg]
        if value == nil then
            value = ''
        end
        new_args[arg] = value;
    end
end        
 
return lng
--[[カテゴリ:Modules]]
Advertisement