Módulo:la-headword
Aparencia
A documentación deste módulo pódese crear en «Módulo:la-headword/uso»
local export = {}
-- this function enables the module to be called from a template
function export.main(frame)
if type(export[frame.args[1]]) == 'function' then
return export[frame.args[1]](frame.args[2], frame.args[3])
else
return export[frame.args[1]][frame.args[2]]
end
end
function export.convert_diacritics(word)
word = mw.ustring.gsub(word, "à", "%E0")
word = mw.ustring.gsub(word, "á", "%E1")
word = mw.ustring.gsub(word, "â", "%E2")
word = mw.ustring.gsub(word, "ã", "%E3")
word = mw.ustring.gsub(word, "ç", "%E7")
word = mw.ustring.gsub(word, "é", "%E9")
word = mw.ustring.gsub(word, "ê", "%EA")
word = mw.ustring.gsub(word, "í", "%ED")
word = mw.ustring.gsub(word, "ó", "%F3")
word = mw.ustring.gsub(word, "ô", "%F4")
word = mw.ustring.gsub(word, "ú", "%FA")
word = mw.ustring.gsub(word, "ü", "%FC")
return word
end
return export