Difference between revisions 18626578 and 18626579 on frwiktionary

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

-- Detect the script based on the first alphabetical characters of a string
function export.detect_script(text, lang)
    local m_scripts = mw.loadData("Module:scripts/tempdata")
    
    local langinfo = m_languages[lang] or error("The language code \"" .. lang .. "\" is not valid.")
    local scFix = false
    
    -- Does this language have more than one script?
    -- If not, we can bypass the detection for a speed bonus.
    -- But always do the detection if the script is "None" or "Zyyy"
(contracted; show full)        i = i + 1
        cat = args[i]
    end
    
    return export.format_categories(categories, lang, sort_key)
end

return export