Difference between revisions 18626563 and 18626565 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)        end
    end
    
    -- not written in native script(s); check for all scripts
    -- TODO: This is slow; we really shouldn't be doing this!
    for script, scriptinfo in pairs(m_scripts) do
        if scriptinfo.characters and mw.ustring.match(text, "[%[%d%p%s]-" .. scriptinfo.characters) then
            return script
, true
        end
    end
end

-- Format the categories with the appropriate sort key
function export.format_categories(categories, lang, sort_key, sort_base)
    local langinfo = languages[lang] or error("The language code \"" .. lang .. "\" is not valid.")
(contracted; show full)        i = i + 1
        cat = args[i]
    end
    
    return export.format_categories(categories, lang, sort_key)
end

return export