Module:Road data/strings/USA
Jump to navigation
Jump to search
Documentation for this module may be created at Module:Road data/strings/USA/doc
--[==[ To inspect the content of this data module, use [[Special:ExpandTemplates]] and enter the following input text: {{#invoke:Road data/dump|dump|module=Module:<name-of-this-module>}} To inspect the content of this data module when editing, enter the following into the Debug console: local util = require("Module:Road data/util") print(util.arrayToString(p)) To inspect a particular route type, change `p` above to include the route type, e.g., `p.I` and `p["US-Hist"]`. ]==] -- United States local USA = {} local util = require("Module:Road data/util") local format = mw.ustring.format --[[ REGION-SPECIFIC SETTINGS ]]-- USA[" common "] = { country = "United States", locations = { indep_city = { linksuffix = ", %region%", prefix = "[[Independent city (United States)|City]] of ", jcttoparticle = "the " }, sub1 = { linksuffix = " County, %region%", jcttopnamesuffix = " County" }, sub2 = { linksuffix = "[sub1dab||, %sub1dab% County|], %region%" }, sub2areas = { city = { linksuffix = " (city)", jcttoparticle = "the ", nameprefix = "City of " }, town = { linksuffix = " (town)", jcttoparticle = "the ", nameprefix = "Town of " }, township = { linksuffix = " Township", namesuffix = " Township", }, village = { linksuffix = " (village)", jcttoparticle = "the ", nameprefix = "Village of " } } } } --[[ ROUTE TYPES ]]-- -- disambiguation switch USA[" dab "] = "[dab|| (%dab%)|]" -- definitions for auxiliary routes USA[" aux "] = { Alt = { name = "Alternate", abbrsuffix = "Alt.", }, Bus = { name = "Business", abbrsuffix = "Bus." }, Byp = { name = "Bypass", abbrsuffix = "Byp.", bannerprefix = "By-pass", aux = "[[Bypass (road)|Bypass]]" }, City = {name = "City"}, Conn = { name = "Connector", abbrsuffix = "Conn." }, Detour = { name = "Detour", aux = "[[Detour (road)|Detour]]" }, Emerg = { name = "Emergency", abbrsuffix = "Emerg." }, Loop = {name = "Loop"}, Opt = { name = "Optional", abbrsuffix = "Opt." }, Scenic = {name = "Scenic"}, Spur = {name = "Spur"}, Temp = { name = "Temporary", abbrsuffix = "Temp." }, Toll = {name = "Toll"}, Truck = {name = "Truck"}, } -- fill out default values for _,entry in pairs(USA[" aux "]) do entry.abbrsuffix = entry.abbrsuffix or entry.name entry.bannerprefix = entry.bannerprefix or entry.name entry.aux = entry.aux or format("[[%s route]]", entry.name) end -- is nonbreaking space. -- ‑ is nonbreaking hyphen. USA.I = { base = "Interstate %route%", shield = "I-%route%.svg", shieldmain= { arg = "state", ["AK"] = "I-A%route%.svg", ["AL"] = "I-%route% (AL).svg", ["AR"] = "I-%route% (AR).svg", ["AZ"] = "I-%route% (AZ).svg", ["CA"] = "I-%route% (CA).svg", ["HI"] = "I-H%route%.svg", ["IA"] = "I-%route% (IA).svg", ["KS"] = "I-%route% (KS).svg", ["MT"] = "I-%route% (big).svg", ["NJ"] = "I-%route% (NJ).svg", ["NM"] = "I-%route% (NM).svg", ["NV"] = "I-%route% (NV).svg", ["NY"] = "I-%route% (long).svg", ["OK"] = "I-%route% (OK).svg", ["PR"] = "I-PR%route%.svg", ["SC"] = "I-%route% (SC).svg", ["TX"] = "I-%route% (TX).svg", ["UT"] = "I-%route% (UT).svg", ["WV"] = "I-%route% (WV).svg", ["WY"] = "I-%route% (WY).svg", default = "I-%route%.svg" }, name = "Interstate %route%", link = "Interstate %route%" .. USA[" dab "], abbr = "I-%route%", width = "expand", bannersuffix = "blue", browse = { {link = "Interstate Highway System", bold = true}, { noprint = true, {link = "List of Interstate Highways", name = "Main"}, {link = "List of auxiliary Interstate Highways", name = "Auxiliary"}, {link = "List of suffixed Interstate Highways", name = "Suffixed"}, {link = "List of business routes of the Interstate Highway System", name = "Business"} } } } USA["I-Alt"] = { shield = USA.I.shield, shieldmain = USA.I.shield, name = USA.I.name .. " Alternate", link = USA.I.base .. " Alternate" .. USA[" dab "], abbr = USA.I.abbr .. " Alt.", banner = { arg = "state", default = "Alternate plate blue.svg", ["DE"] = "Alt plate blue.svg", ["FL"] = "Alt plate blue.svg", ["KS"] = "Alt plate blue.svg", ["MS"] = "Alt plate blue.svg", ["NV"] = "Alt plate blue.svg", ["NJ"] = "Alt plate blue.svg", ["OH"] = "Alt plate blue.svg", ["OK"] = "Alt plate blue.svg", ["SC"] = "Alt plate blue.svg", ["WV"] = "Alt plate blue.svg", ["DC"] = "Alt plate blue.svg", }, bannersuffix = USA.I.bannersuffix, aux = "[[Alternate route]]", width = "expand", browse = USA.I.browse } USA["I-Toll"] = { shield = USA.I.shield, name = USA.I.name .. " Toll", link = USA.I.link, abbr = USA.I.abbr, banner = "Toll plate yellow.svg", bannersuffix = USA.I.bannersuffix, width = "expand", browse = USA.I.browse } USA["I-Future"] = { shield = "I-%route% (Future).svg", name = USA.I.name, link = USA.I.link, abbr = "Future " .. USA.I.abbr, bannersuffix = USA.I.bannersuffix, browse = USA.I.browse } USA.Future = USA["I-Future"] USA["I-Temp"] = { shield = USA.I.shield, shieldmain = USA.I.shieldmain, name = "Temporary " .. USA.I.name, link = USA.I.link, abbr = "Temp " .. USA.I.abbr, banner = "Temporary plate blue.svg", bannersuffix = USA.I.bannersuffix, browse = USA.I.browse } USA["I-Temporary"] = USA["I-Temp"] USA["I 1957"] = { shield = "I-%route% (1957).svg", shieldmain = "I-%route% (%state% 1957).svg", name = USA.I.name, link = USA.I.link, abbr = USA.I.abbr, browse = USA.I.browse } USA["I 1961"] = { shield = { hook = "splitlen", split = 3, above = "I-%route% (1961).svg", below = "I-%route% (1957).svg" }, shieldmain = { hook = "splitlen", split = 3, above = "I-%route% (%state% 1961).svg", below = "I-%route% (%state% 1957).svg" }, name = USA.I.name, link = USA.I.link, abbr = USA.I.abbr, browse = USA.I.browse } USA.BL = { shield = "Business Loop %route%.svg", shieldmain = "Business Loop %route%.svg", name = USA.I.name .. " Business", link = USA.I.base .. " Business" .. USA[" dab "], abbr = USA.I.abbr .. " BL", aux = "[[List of business routes of the Interstate Highway System|Business route]]", browse = USA.I.browse, width = "expand" } USA.BS = { shield = "Business Spur %route%.svg", shieldmain = "Business Spur %route%.svg", name = USA.BL.name, link = USA.BL.link, abbr = USA.I.abbr .. " BS", aux = USA.BL.aux, browse = USA.I.browse, width = "expand" } USA["BL 1957"] = { shield = "Business Loop %route% (1957).svg", name = USA.BL.name, link = USA.BL.link, abbr = USA.BL.abbr, aux = USA.BL.aux, browse = USA.I.browse } USA["BS 1957"] = { shield = "Business Spur %route% (1957).svg", name = USA.BS.name, link = USA.BS.link, abbr = USA.BS.abbr, aux = USA.BS.aux, browse = USA.I.browse } USA.US = { base = "U.S. Route %route%", shield = { arg = "state", ["CA"] = "US %route% (1961 cutout).svg", default = "US %route%.svg" }, shieldmain = { arg = "state", ["CA"] = "US %route% (1961 cutout).svg", default = { ["85"] = {"US %route%.svg", "CanAm Highway.svg"}, default = "US %route%.svg" } }, name = "U.S. Route %route%", link = "U.S. Route %route%" .. USA[" dab "], abbr = "US %route%", width = "expand", browse = { {link = "United States Numbered Highway System", bold = true}, {noprint = true, {link = "List of U.S. Routes", name = "Main"}, {link = "List of bannered U.S. Routes", name = "Bannered"}, {link = "List of divided U.S. Routes", name = "Divided"}, {link = "List of highways bypassed by Interstate Highways", name = "Replaced"} } } } USA.road = { shield = '', shieldmain = '', name = "%route%", link = '', abbr = "%route%", browse = '', } for _,auxType in ipairs({"Alt", "Bus", "Byp", "Conn", "Opt", "Scenic", "Spur", "Temp", "Truck"}) do local spec = USA[" aux "][auxType] USA["US-" .. auxType] = { shield = USA.US.shield, shieldmain = USA.US.shield, name = USA.US.name .. " " .. spec.name, link = USA.US.base .. " " .. spec.name .. USA[" dab "], abbr = USA.US.abbr .. " " .. spec.abbrsuffix, banner = spec.bannerprefix .. " plate.svg", aux = spec.aux, width = "expand", browse = USA.US.browse } end USA["US-Hist"] = { shield = "[state||US %route% (%state% historic).svg|US %route% (historic).svg]", name = "Historic " .. USA.US.name, link = USA.US.base .. USA[" dab "], abbr = "Historic " .. USA.US.abbr .. USA[" dab "], orientation = "upright", color = "hist", browse = USA.US.browse } for _,year in ipairs({"1926", "1948", "1961"}) do USA["US " .. year] = { shield = format("US %%route%% (%s).svg", year), shieldmain = format("US %%route%% (%s).svg", year), base = USA.US.base, name = USA.US.name, link = USA.US.link, abbr = USA.US.abbr, width = "square", browse = USA.US.browse } end USA.FFH = { shield = "Forest Route %route%.svg", name = "Federal Forest Highway %route%", link = "Forest Highway %route%", abbr = "FFH %route%", color = "hist", bannersuffix = "brown" } USA.FH = { shield = "Forest Route %route%.svg", name = "Forest Highway %route%", link = "Forest Highway %route%", abbr = "FH %route%", color = "hist", bannersuffix = "brown" } USA.FR = { shield = "Forest Route %route%.svg", name = "Forest Route %route%", link = "Forest Highway %route%", abbr = "FR %route%", color = "hist", bannersuffix = "brown" } USA.NSB = { shield = "MUTCD D6-4.svg", name = "%route%", link = "%route%", abbr = "%route%", color = "hist" } USA.CR = { shield = "CR %route% jct.svg", shieldmain = "[county||%county% |]County %route%.svg", base = "County Road %route%", name = "County Road %route%", link = "", abbr = "CR %route%" } -- https://mutcd.fhwa.dot.gov/resources/interim_approval/ialistreq.htm#ia15 USA.USBR = { shield = { arg = "state", ["AZ"] = "US Bike %route% (M1-9 IA-15).svg", ["CA"] = "US Bike %route% (M1-9 IA-15).svg", ["GA"] = "US Bike %route% (M1-9 IA-15).svg", ["ID"] = "US Bike %route% (M1-9 IA-15).svg", ["IL"] = "US Bike %route% (M1-9 IA-15).svg", ["IN"] = "US Bike %route% (M1-9 IA-15).svg", ["KY"] = "US Bike %route% (M1-9 IA-15).svg", ["MD"] = "US Bike %route% (M1-9 IA-15).svg", ["MI"] = "US Bike %route% (M1-9 IA-15).svg", ["MO"] = "US Bike %route% (M1-9 IA-15).svg", ["OH"] = "US Bike %route% (M1-9 IA-15).svg", ["TN"] = "US Bike %route% (M1-9 IA-15).svg", ["UT"] = "US Bike %route% (M1-9 IA-15).svg", ["VA"] = "US Bike %route% (M1-9 IA-15).svg", ["WV"] = "US Bike %route% (M1-9 IA-15).svg", default = "US Bike %route% (M1-9).svg" }, name = "U.S. Bicycle Route %route%", link = "U.S. Bicycle Route %route%" .. USA[" dab "], abbr = "USBR %route%", orientation = "upright" } util.addAll(USA, require("Module:Road data/strings/USA/regional/GRR")) util.addAll(USA, require("Module:Road data/strings/USA/regional/NER")) util.addAll(USA, require("Module:Road data/strings/USA/regional/Tour")) util.addAll(USA, require("Module:Road data/strings/USA/regional/Trails")) return USA