Módulo:YesnoTNT
Utilitzado por {{YesnoTNT}}
. Utiliza Commons:Data:I18n/Yesno.tab.
-- Function allowing for consistent treatment of boolean-like wikitext input.
local TNTTab = 'Yesno'
local TNTT = require('Module:TNTTools')
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 TNTT.SFoundInTNTArr(TNTTab,val,true,'Yes') or tonumber(val) == 1
then
return true
elseif (val == false) or TNTT.SFoundInTNTArr(TNTTab,val,true,'No') or tonumber(val) == 0
then
return false
else
return default
end
end