--[[
Source script: https://it.wikivoyage.org/wiki/Modulo:IsLatin
Maintainer: Andyrom75
]]
local function _isDefined(s)
return s ~= '' and s
end
local p = {}
function p.IsLatin(frame)
return frame.args and p.IsLatinValue(frame.args[1]) or ''
end
function p.IsLatinValue(txt)
if _isDefined(txt) then
local len = mw.ustring.len(txt)
local pos = 1
while ( pos <= len ) do
charval = mw.ustring.codepoint(mw.ustring.sub(txt, pos))
-- note 8364 is the € symbol
if charval>687 and charval~=8364 then
return "no"
end
pos = pos + 1
end
return "sì"
else
return ''
end
end
return p