Modul:Yesno


Túto dokumentáciu [vytvoriť] [obnoviť]
Dokumentácia Dokumentácia

Dokumentácia pre tento modul zatiaľ neexistuje. Môžete ju vytvoriť na Modul:Yesno/Dokumentácia


Ak máte otázku k tomuto modulu, alebo potrebujete jeho rozšírenie a neviete ho správne naformátovať, pýtajte sa v diskusii k modulu. Pokiaľ je potrebné modul urgentne opraviť, obráťte sa na technickú podporu.

-- Function allowing for consistent treatment of boolean-like wikitext input.-- It works similarly to the template {{yesno}}.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 valif val == nil thenreturn nilelseif val == true or val == 'ano'or val == 'áno'or val == 'a'or val == 'yes'or val == 'y'or val == 'true'or val == 't'or tonumber(val) == 1thenreturn trueelseif val == falseor val == 'nie'or val == 'no'or val == 'n'or val == 'false'or val == 'f'or tonumber(val) == 0thenreturn falseelsereturn defaultendend