Difference between revisions 18626523 and 18626524 on frwiktionary

local languages = mw.loadData("Module:languages")
local export = {}
 
-- Create a tagged text from a given text. This is equivalent of the script templates.
function export.tag_text(text, lang, tag, class)
    return "<" .. (tag or "span") .. (class and (" class=\"" .. class .. "\"") or "")
           .. " lang=\"" .. lang .. "\">" .. text .. "</" .. (tag or "span") .. ">"
end
 
-- transliterate the text, if possible
function export.translit(lang, text)
    -- TODO: the table's information should be moved to [[Module:languages]]
    local translit_modules = {
        ["ae"] = "Module:Avst-translit",
        ["ady"] = "Module:ady-translit",
        ["el"] = "Module:el-translit",
        ["ru"] = "Module:ru-translit",
        ["ug"] = "Module:ug-translit",
        ["tg"] = "Module:tg-translit",
        ["ka"] = "Module:ka-translit",  
        ["xcl"] = "Module:xcl-translit",
        ["axm"] = "Module:axm-translit",
        ["hy"] = "Module:hy-translit"
(contracted; show full)            text = text .. "&nbsp;" .. gen.format_list(gender)
        end
    end
 
    return text
end
 
return export