Difference between revisions 18626517 and 18626519 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 "")
(contracted; show full)        ["ug-Arab"] = "ۈۇې",        
        -- TODO
    }
 
    -- first try to detect the script based on the native scripts of the language
    local scripts = languages[lang].scripts or {}
    for i, script in ipairs(scripts) do
        if 
chars_table[script] and mw.ustring.match(text, "[%[%*%d%p%s]-[" .. chars_table[script] .. "]") then
            return script
        end
    end
 
    -- not written in native scripts; check for all scripts
    for script, chars in ipairs(chars_table) do
        if mw.ustring.match(text, "[%[%d%p%s]-[" .. chars .. "]") then
(contracted; show full)            text = text .. "&nbsp;" .. gen.format_list(gender)
        end
    end
 
    return text
end
 
return export