View source for Module:Engvar
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
-- This module implements Template:Engvar.
-- Template:Engvar is to be build into the template (like an infobox), with default & variant spellings defined.
-- That template should also allow parameter '|engvar=' for the editor (article page).
-- The module/template Engvar then returns the spelling variant as is set in that article (for example '|engvar=en-GB').
-- The defaultWord is returned, unless the engvar input hits on a defined (en-XX) variant word.
local p = {}
local getArgs = require('Module:Arguments').getArgs
local gsub = string.gsub
local lower = string.lower
local upper = string.upper
function p.variants(frame)
local args = getArgs(frame)
return p._variants(args)
end
function p._variants(args)
local returnWord = nil
local defaultWord = args.defaultWord or ''
if args.engvar == nil then
-- Nothing to look for; use defaultWord right away
000
1:0
Template used on this page:
Return to Module:Engvar.