Module:Jct/statename: Difference between revisions
Appearance
Content deleted Content added
Replacing {{jct/statename}} |
Copying from Module:Jct/statename/data |
||
Line 1: | Line 1: | ||
local p = { |
local p = {} |
||
p.statenames = { |
|||
function p.statename(frame) |
|||
["AL"] = "Alabama", |
|||
local pframe = frame:getParent() |
|||
["AK"] = "Alaska", |
|||
local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself |
|||
["AZ"] = "Arizona", |
|||
local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template |
|||
["AR"] = "Arkansas", |
|||
["CA"] = "California", |
|||
local dualabbrs = {NT = "Northern Territory", WA = "Western Australia"} |
|||
["CO"] = "Colorado", |
|||
["CT"] = "Connecticut", |
|||
local data = mw.loadData("Module:Jct/statename/data") |
|||
["DE"] = "Delaware", |
|||
local abbr = args[1] |
|||
["DC"] = "District of Columbia", |
|||
local country = args[2] |
|||
["FL"] = "Florida", |
|||
if country == 'AUS' then |
|||
["GA"] = "Georgia", |
|||
return dualabbrs[abbr] or data.statenames[abbr] |
|||
["HI"] = "Hawaii", |
|||
else |
|||
["ID"] = "Idaho", |
|||
return data.statenames[abbr] |
|||
["IL"] = "Illinois", |
|||
end |
|||
["IN"] = "Indiana", |
|||
end |
|||
["IA"] = "Iowa", |
|||
["KS"] = "Kansas", |
|||
["KY"] = "Kentucky", |
|||
["LA"] = "Louisiana", |
|||
["ME"] = "Maine", |
|||
["MD"] = "Maryland", |
|||
["MA"] = "Massachusetts", |
|||
["MI"] = "Michigan", |
|||
["MN"] = "Minnesota", |
|||
["MS"] = "Mississippi", |
|||
["MO"] = "Missouri", |
|||
["MT"] = "Montana", |
|||
["NE"] = "Nebraska", |
|||
["NV"] = "Nevada", |
|||
["NH"] = "New Hampshire", |
|||
["NJ"] = "New Jersey", |
|||
["NM"] = "New Mexico", |
|||
["NY"] = "New York", |
|||
["NC"] = "North Carolina", |
|||
["ND"] = "North Dakota", |
|||
["OH"] = "Ohio", |
|||
["OK"] = "Oklahoma", |
|||
["OR"] = "Oregon", |
|||
["PA"] = "Pennsylvania", |
|||
["RI"] = "Rhode Island", |
|||
["SC"] = "South Carolina", |
|||
["SD"] = "South Dakota", |
|||
["TN"] = "Tennessee", |
|||
["TX"] = "Texas", |
|||
["UT"] = "Utah", |
|||
["VT"] = "Vermont", |
|||
["VA"] = "Virginia", |
|||
["WA"] = "Washington", |
|||
["WV"] = "West Virginia", |
|||
["WI"] = "Wisconsin", |
|||
["WY"] = "Wyoming", |
|||
["PR"] = "Puerto Rico", |
|||
["VI"] = "U.S. Virgin Islands", |
|||
["AB"] = "Alberta", |
|||
["BC"] = "British Columbia", |
|||
["MB"] = "Manitoba", |
|||
["NB"] = "New Brunswick", |
|||
["NL"] = "Newfoundland and Labrador", |
|||
["NS"] = "Nova Scotia", |
|||
["NT"] = "Northwest Territories", |
|||
["NU"] = "Nunavut", |
|||
["ON"] = "Ontario", |
|||
["PE"] = "Prince Edward Island", |
|||
["QC"] = "Quebec", |
|||
["SK"] = "Saskatchewan", |
|||
["YT"] = "Yukon", |
|||
["AS"] = "American Samoa", |
|||
["GU"] = "Guam", |
|||
["MP"] = "Northern Marianas", |
|||
["ACT"] = "Australian Capital Territory", |
|||
["NSW"] = "New South Wales", |
|||
["QLD"] = "Queensland", |
|||
["SA"] = "South Australia", |
|||
["TAS"] = "Tasmania", |
|||
["VIC"] = "Victoria", |
|||
["fr"] = "France", |
|||
["de"] = "Germany", |
|||
["gb"] = "United Kingdom", |
|||
["es"] = "Spain", |
|||
["ie"] = "Ireland", |
|||
["it"] = "Italy", |
|||
["se"] = "Sweden", |
|||
["no"] = "Norway", |
|||
["fi"] = "Finland", |
|||
["dk"] = "Denmark", |
|||
["nl"] = "Netherlands", |
|||
["be"] = "Belgium", |
|||
["lu"] = "Luxembourg", |
|||
["pt"] = "Portugal", |
|||
} |
|||
return p |
return p |
Revision as of 09:39, 19 June 2014
local p = {}
p.statenames = {
["AL"] = "Alabama",
["AK"] = "Alaska",
["AZ"] = "Arizona",
["AR"] = "Arkansas",
["CA"] = "California",
["CO"] = "Colorado",
["CT"] = "Connecticut",
["DE"] = "Delaware",
["DC"] = "District of Columbia",
["FL"] = "Florida",
["GA"] = "Georgia",
["HI"] = "Hawaii",
["ID"] = "Idaho",
["IL"] = "Illinois",
["IN"] = "Indiana",
["IA"] = "Iowa",
["KS"] = "Kansas",
["KY"] = "Kentucky",
["LA"] = "Louisiana",
["ME"] = "Maine",
["MD"] = "Maryland",
["MA"] = "Massachusetts",
["MI"] = "Michigan",
["MN"] = "Minnesota",
["MS"] = "Mississippi",
["MO"] = "Missouri",
["MT"] = "Montana",
["NE"] = "Nebraska",
["NV"] = "Nevada",
["NH"] = "New Hampshire",
["NJ"] = "New Jersey",
["NM"] = "New Mexico",
["NY"] = "New York",
["NC"] = "North Carolina",
["ND"] = "North Dakota",
["OH"] = "Ohio",
["OK"] = "Oklahoma",
["OR"] = "Oregon",
["PA"] = "Pennsylvania",
["RI"] = "Rhode Island",
["SC"] = "South Carolina",
["SD"] = "South Dakota",
["TN"] = "Tennessee",
["TX"] = "Texas",
["UT"] = "Utah",
["VT"] = "Vermont",
["VA"] = "Virginia",
["WA"] = "Washington",
["WV"] = "West Virginia",
["WI"] = "Wisconsin",
["WY"] = "Wyoming",
["PR"] = "Puerto Rico",
["VI"] = "U.S. Virgin Islands",
["AB"] = "Alberta",
["BC"] = "British Columbia",
["MB"] = "Manitoba",
["NB"] = "New Brunswick",
["NL"] = "Newfoundland and Labrador",
["NS"] = "Nova Scotia",
["NT"] = "Northwest Territories",
["NU"] = "Nunavut",
["ON"] = "Ontario",
["PE"] = "Prince Edward Island",
["QC"] = "Quebec",
["SK"] = "Saskatchewan",
["YT"] = "Yukon",
["AS"] = "American Samoa",
["GU"] = "Guam",
["MP"] = "Northern Marianas",
["ACT"] = "Australian Capital Territory",
["NSW"] = "New South Wales",
["QLD"] = "Queensland",
["SA"] = "South Australia",
["TAS"] = "Tasmania",
["VIC"] = "Victoria",
["fr"] = "France",
["de"] = "Germany",
["gb"] = "United Kingdom",
["es"] = "Spain",
["ie"] = "Ireland",
["it"] = "Italy",
["se"] = "Sweden",
["no"] = "Norway",
["fi"] = "Finland",
["dk"] = "Denmark",
["nl"] = "Netherlands",
["be"] = "Belgium",
["lu"] = "Luxembourg",
["pt"] = "Portugal",
}
return p