Module:Yesno: Difference between revisions
Content deleted Content added
m Protected "Module:Yesno": High-risk Lua module ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
m 1 revision imported |
||
Line 6: | Line 6: | ||
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the |
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the |
||
-- following line. |
-- following line. |
||
val = type(val) == 'string' and |
val = type(val) == 'string' and mw.ustring.lower(val) or val |
||
if val == nil then |
if val == nil then |
||
return nil |
return nil |
||
elseif val == true |
elseif val == true |
||
or val == 'sim' |
|||
or val == 's' |
|||
or val == 'verdadeiro' |
|||
or val == 'yes' |
or val == 'yes' |
||
or val == 'y' |
or val == 'y' |
||
Line 18: | Line 21: | ||
return true |
return true |
||
elseif val == false |
elseif val == false |
||
or val == 'não' |
|||
or val == 'nao' |
|||
or val == 'falso' |
|||
or val == 'no' |
or val == 'no' |
||
or val == 'n' |
or val == 'n' |