Difference between revisions 18626558 and 18626559 on frwiktionary

local languages = mw.loadData("Module:languages")
local export = {}

-- 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",
(contracted; show full)    for i, script in ipairs(scripts) do
        if chars_table[script] and mw.ustring.match(text, "[" .. chars_table[script] .. "]") then
            return script
        end
    end
    
    -- not written in native script(s); check for all scripts
    for script, chars in 
ipairs(chars_table) do
        if mw.ustring.match(text, "[%[%d%p%s]-[" .. chars .. "]") then
            return script
        end
    end
end

-- Format the categories with the appropriate sort key
(contracted; show full)        i = i + 1
        cat = args[i]
    end
    
    return export.format_categories(categories, lang, sort_key)
end

return export