Module:Yesno

local yesFilter = { "yes"; "y"; "true"; "t"; 1;   true; }; local noFilter = { "no"; "n"; "false"; "f"; 0;  false; };

local function isInFilter(filter,arg) local result = false for _, item in pairs(filter) do       if item == arg or tonumber(arg) == item then result = true end end return result end

return function (val, default) -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you -- should replace "val:lower" with "mw.ustring.lower(val)" in the -- following line. val = type(val) == 'string' and val:lower or val if not val then return nil elseif isInFilter(yesFilter,val)	then return true elseif isInFilter(noFilter,val) then return false else return default end end