Module:umu-translit

From Linguifex
Revision as of 12:46, 21 April 2026 by Sware (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:umu-translit/doc

local export = {}

local replacements = {
    ["aa"] = "ā", ["ee"] = "ē", ["ii"] = "ī", ["oo"] = "ō",
    ["ch"] = "č", ["sh"] = "š", ["zh"] = "ž"
}

function export.tr(text)
    local output = text
    
    -- Perform all replacements
    for key, value in pairs(replacements) do
        output = output:gsub(key, value)
    end
    
    return output
end

return export