Module:ii-translit

Revision as of 09:22, 27 April 2024 by wikt>SurjectionBot (Protected "Module:ii-translit": (bot) automatically protect highly visible templates/modules (reference score: 1497+ >= 1000) ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite)))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

local export = {}
local gsub = mw.ustring.gsub

local convert = mw.loadData("Module:ii-translit/data")

function export.tr(text, lang, sc)
	text = gsub(text:gsub("%^", ""), "[^%s*]", " %0")
	text = gsub(text, " ([%Aꀕ])", "%1") -- Iteration mark appends "w" onto previous syllable.
	return (gsub(text, "%S", convert))
end

return export