Module:Jct/statename
Appearance
Documentation for this module may be created at Module:Jct/statename/doc
local p = { }
function p.statename(frame)
local pframe = frame:getParent()
local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template
local dualabbrs = {NT = "Northern Territory", WA = "Western Australia"}
local data = mw.loadData("Module:Jct/statename/data")
local abbr = args[1]
local country = args[2]
if country == 'AUS' then
return dualabbrs[abbr] or data.statenames[abbr]
else
return data.statenames[abbr]
end
end
return p