Module:Yesno

-- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template.

return function (val, default) -- 如果你的维基使用非ASCII字符来表示 "是"、"否 "等等 -- 你应该在下面一行用 "mw.ustring.lower(val) "替换 "val:lower". val = type(val) == 'string' and mw.ustring.lower(val) or val if val == nil then return nil elseif val == true or val == '是' or val == 'yes' or val == 'y'		or val == 'true' or val == 't'		or tonumber(val) == 1 then return true elseif val == false or val == '否' or val == 'no' or val == 'n'		or val == 'false' or val == 'f'		or tonumber(val) == 0 then return false else return default end end