Module:Engvar: Difference between revisions

Content deleted Content added
sync from sandbox, add "auto" and "fallback" options
Sync with sandbox, answer edit request
 
Line 34:
function p._variants(args)
local returnWord = nil
local auto = ((args.engvar or '') == 'auto')false
 
local defaultWord = args.defaultWord or ''
local engvar = auto and require('Module:Engvar/detect').detect() or args.engvar
local defaultWord = args.defaultWord or ''
local engvar = args.engvar
 
if (lower(engvar or '') == 'auto') then
local engvar = auto and require('Module:Engvar/detect').detect() or args.engvar
auto = true
end
 
if engvar == nil then
-- Nothing to look for; use defaultWord right away