Module:Road data/strings/USA/CA

From Cube Studios Wiki

Documentation for this module may be created at Module:Road data/strings/USA/CA/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"]`.
]==]

-- California
local CA = {}

local util = require("Module:Road data/util")
util.addAll(CA, require("Module:Road data/strings/USA"))
local format = mw.ustring.format

local suffix = " ([dab||%dab%, |]California)"

CA.I.shield = CA["I 1961"].shield
CA.I.link = {
	["8"] = "Interstate 8",
	["505"] = "Interstate 505",
	["605"] = "Interstate 605",
	["805"] = "Interstate 805",
	["905"] = "Interstate 905",
	["710"] = "Interstate 710",
	["238"] = "Interstate 238",
	["780"] = "Interstate 780",
	["980"] = "Interstate 980",
	default = {
		hook = "split",
		split = 100,
		above = "Interstate %route% (California)",
		below = "Interstate %route% in California"
	}
}
CA.I.law = "[[wikisource:California Streets and Highways Code/Section 301-635#Route %route%|SHC § %section%]]"

for k, v in pairs(CA) do if k:find ("^I%-") then
	v.shield = CA.I.shield
	v.shieldmain = CA.I.shieldmain
	end
end

for k, v in pairs(CA) do if k:find ("^I") then 
	v.link = CA.I.link
	end
end

CA.BL.shield = "Business Loop %route% (CA).svg"
CA.BL.shieldmain = CA.BL.shield
CA.BL.link = CA.I.base .. " Business" .. suffix

for k, v in pairs(CA) do if k:find ("^B%a") then 
	v.link = CA.BL.link
	end
end

CA["I-Express"].shield = CA.I.shield
CA["I-Express"].name = "I-%route% Express Lanes"
CA["I-Express"].link = {
		["10"] = "El Monte Busway",
		["110"] = "Harbor Transitway",
		default = CA.I.link
	}
CA["I-Express"].abbr = "I-%route% Express Lanes"
CA["I-Express"].banner = "Express plate.svg" --  Caltrans does not use the yellow express plates, opting instead for white signage

-- I-5/SR 14/Newhall Pass and I-5/I-405/Mission Hills use "Truck Route"
-- I-5/SR 99/Wheeler Ridge, I-15/I-215/Devore, and I-580/I-205 instead use "Truck Bypass"
CA["I-Truck"].link = "Interstate %route% Truck ([dab||%dab%, |]California)"
CA["I-Truck"].banner = "Truck plate.svg" --  Caltrans does not use the blue truck plates, opting instead for white signage

CA.US.link = {
	["199"] = "U.S. Route 199",
	["299"] = "U.S. Route 299",
	["399"] = "U.S. Route 399",
	["466"] = "U.S. Route 466",
	default ="U.S. Route %route% in California"
}
CA.US.law = CA.I.law

CA["US-Express"] = {
	shield = CA.US.shield,
	name = "US&nbsp;%route% Express Lanes",
	link = CA.US.link,
	abbr = "US&nbsp;%route% Express Lanes",
	banner = "Express plate.svg", --  Caltrans does not use the yellow express plates, opting instead for white signage
	width = "expand",
	nbrowse = CA.US.browse,
	nbrowselinks = CA.US.browselinks,
}

CA["US 1926-Alt"] = {
	shield = CA["US 1926"].shield,
	shieldmain = CA["US 1926"].shieldmain,
	name = CA["US-Alt"].name,
	link = CA["US-Alt"].link,
	abbr = CA["US-Alt"].abbr,
	banner = "Business plate 1927.svg",
	nbrowse = CA.US.browse,
	nbrowselinks = CA.US.browselinks
}
CA["US-Alt 1926"] = CA["US 1926-Alt"]
	     
CA["US 1948-Alt"] = {
	shield = CA["US 1948"].shield,
	shieldmain = CA["US 1948"].shieldmain,
	name = CA["US-Alt"].name,
	link = CA["US-Alt"].link,
	abbr = CA["US-Alt"].abbr,
	banner = "Alternate plate 1948.svg",
	width = "expand",
	nbrowse = CA.US.browse,
	nbrowselinks = CA.US.browselinks
}

CA["US 1948-Bus"] = {
	shield = CA["US 1948"].shield,
	shieldmain = CA["US 1948"].shieldmain,
	name = CA["US-Bus"].name,
	link = CA["US-Bus"].link,
	abbr = CA["US-Bus"].abbr,
	banner = "Business plate 1948.svg",
	nbrowse = CA.US.browse,
	nbrowselinks = CA.US.browselinks
}

for _,auxType in ipairs({"Alt", "Bus", "Byp", "City", "Conn", "Emerg", "Opt", "Scenic", "Spur", "Temp", "Toll", "Truck"}) do
	local spec = CA[" aux "][auxType]
		for k, v in pairs(CA) do if k:find (auxType) then if k:find ("^US") then
			v.link = CA.US.base .. " " .. spec.name .. suffix
			end
		end
	end
end

for k, v in pairs(CA) do if k:find ("^US %d") then
	v.link = CA.US.link
	end
end

CA["US-Hist"].link = "Historic " .. CA.US.base .. " (California)"

CA.SR = {
	base = "California State Route %route%",
	shield = "California %route%.svg",
	shieldmain = {
		["162"] = {"California %route%.svg", "Forest Route 7.svg"},
		["185"] = {"California %route%.svg", "California 77.svg"},
		default = "California %route%.svg"
	},
	name = {
		["162"] = "State Route %route% and<br>State Route 7",
		["185"] = "State Route %route% and<br>State Route 77",
		default = "State Route %route%"
	},
	link = "California State Route %route% [dab||(%dab%)|]",
	abbr = "SR&nbsp;%route%",
	bannersuffix = "green",
	law = CA.I.law
}
CA.CA = CA.SR

for _,type in ipairs({'SR', 'CA'}) do
	for _,year in ipairs({"1934 S", "1948", "1957"}) do
		CA[type .. " " .. year] = {
			shield = format("California %%route%% %s.svg", year),
			name = CA.SR.name.default,
			link = CA.SR.link,
			abbr = CA.SR.abbr,
			bannersuffix = ""
		}
	end
end

for _,type in ipairs({'SR', 'CA'}) do
	for _,auxType in ipairs({"Alt", "Bus", "Byp", "Conn", "Opt", "Scenic", "Spur", "Temp", "Toll", "Truck"}) do
		local spec = CA[" aux "][auxType]
		CA[type .. "-" .. auxType] = {
			shield = CA.SR.shield,
			name = CA.SR.name.default .. " " .. spec.name,
			link = CA.SR.base .. " " .. spec.name .. CA[" dab "],
			abbr = CA.SR.abbr .. " " .. spec.abbrsuffix,
			banner = spec.bannerprefix .. " plate green.svg",
			bannersuffix = "green",
			aux = spec.aux,
			width = "expand"
		}
	end
end

CA["SR-Toll"].link = {
	["125"] = "South Bay Expressway",
	default = CA.SR.link
}
CA["CA-Toll"].link = CA["SR-Toll"].link

CA["SR-Toll"].banner = "Toll plate yellow.svg"
CA["CA-Toll"].banner = CA["SR-Toll"].banner

-- The 91 Express Lanes do not use the SR abbreviation, but those in the Bay Area do 
CA["SR-Express"] = {	shield = CA.SR.shield,
	name = {
		["91"] = "91 Express Lanes",
		default = "SR&nbsp;%route% Express Lanes"
	},
	link = {
		["91"] = "91 Express Lanes",
		default = CA.SR.link
	},
	abbr = {
		["91"] = "91 Express Lanes",
		default = "SR&nbsp;%route% Express Lanes"
	},
	bannersuffix = "green",
	banner = "Express plate.svg" --  Caltrans does not use the yellow express plates, opting instead for white signage
}
CA["CA-Express"] = CA["SR-Express"]

CA["SR-Hist"] = {	shield = CA.SR.shield,
	name = "Historic State Route %route%",
	link = "Historic " .. CA.SR.base,
	abbr = "Historic SR&nbsp;%route%",
	bannersuffix = "brown"
	}
CA["CA-Hist"] = CA["SR-Hist"]

CA.FH.shieldmain = {
	["59"] = {"Los Angeles County N3.svg", CA.FH.shield},
	default = CA.FH.shield
}

CA.ISR = {
	shield = {CA.I.shield, CA.SR.shield},
	shieldmain = {CA.I.shieldmain, CA.SR.shield},
	name = CA.I.name .. " and " .. CA.SR.name.default,
	link = CA.I.link,
	abbr = "Route %route%",
	bannersuffix = {"blue", "green"},
	nbrowse = CA.I.browse,
	nbrowselinks = CA.I.browselinks,
	law = CA.I.law
}

-- add new types above this line if you want it to have the state highway browse and maint
for k, v in pairs(CA) do if k:find ("^%a") then
	v.maint = "[[California Department of Transportation|Caltrans]]"
	v.browse = "[[State highways in California]]"
	v.browselinks = {
		[1] = "[[List of Interstate Highways in California|Interstate]]",
		[2] = "[[List of U.S. Routes in California|US]]",
		[3] = "[[List of state highways in California|State]]",
		[4] = "[[State Scenic Highway System (California)|Scenic]]",
		[5] = "[[List of state highways in California (pre-1964)|Pre-1964]]",
		[6] = "[[History of California's state highway system|History]]",
		[7] = "[[List of unconstructed state highways in California|Unconstructed]]",
		[8] = "[[List of deleted state highways in California|Deleted]]",
		[9] = "[[California Freeway and Expressway System|Freeways]]"
	}
	end
end

CA["CA 1934 S"].maint = "[[California Department of Public Works]]"
CA["CA 1948"].maint = CA["CA 1934 S"].maint

CA.CR.link = "County Route %route% (California)"
CA.CR.maint = ""

CA["I-OR"] = {alias = {module = "USA/OR", type = "I"}}
CA["US-NV"] = {alias = {module = "USA/NV", type = "US"}}
CA.AZ = {alias = {module = "USA/AZ", type = "SR"}}
CA.NV = {alias = {module = "USA/NV", type = "SR"}}
CA.OR = {alias = {module = "USA/OR", type = "OR"}}
CA.MEX = {alias = {module = "MEX", type = "FH"}}

return CA
Cookies help us deliver our services. By using our services, you agree to our use of cookies.