Module:Yesno

番版𠓨𣅶10:32、𣈜6𣎃1𢆥2016𧵑SaigonSarang (討論 | 㨂𢵰) (1 翻版)

-- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template . return function (val, default) val = type(val) == 'string' and mw.ustring.lower(val) or val if val == nil then return nil elseif val == true or val == 'yes' or val == 'có' or val == 'y' or val == 'c' or val == 'true' or val == 'thực' or val == 't' or val == 'rồi' or tonumber(val) == 1 then return true elseif val == false or val == 'no' or val == 'không' or val == 'n' or val == 'ko' or val == 'k' or val == 'false' or val == 'sai' or val == 'f' or val == 's' or val == 'chưa' or tonumber(val) == 0 then return false else return default end end