Jump to content

Module:Road data/strings/USA/PR

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Fredddie (talk | contribs) at 22:45, 9 August 2022 (define shields first). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

--[==[
To inspect the content of this data module, PRe [[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["PR-Hist"]`.
]==]

-- Puerto Rico
local PR = {}

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

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

PR.I.shield = "I-PR%route%.svg"
PR.I.link = "Interstate PR%route%"
PR.I.abbr = "PRI-%route%"

local primary = primary
local urban = urban
local secondary = secondary
local tertiary = tertiary

local shieldmain = {
	default = {
		hook = "splitlen",
		split = 3,
		above = {
			hook = "split",
			split = 300,
			above = tertiary,
			below = secondary
		},
		below = primary
	},
	["1"] = {primary, urban, secondary, tertiary},
	["1P"] = {urban, tertiary},
	["1R"] = {urban, tertiary},
	["2"] = {primary, urban, secondary},
	["2R"] = urban,
	["3"] = {primary, urban, secondary, tertiary},
	["3R"] = urban,
	["5"] = {primary, urban, secondary, tertiary},
	["6"] = urban,
	["8"] = urban,
	["9"] = urban,
	["14"] = {urban, secondary, tertiary},
	["14P"] = urban,
	["14R"] = tertiary,
	["15"] = {urban, tertiary},
	["16"] = urban,
	["17"] = {primary, urban},
	["19"] = tertiary,
	["21"] = {urban, tertiary},
	["22"] = {"PR toll roads.svg", primary},
	["23"] = urban,
	["24"] = tertiary,
	["25"] = urban,
	["25P"] = urban,
	["25R"] = urban,
	["27"] = {urban, tertiary},
	["28"] = tertiary,
	["29"] = tertiary,
	["31"] = {secondary, tertiary},
	["32"] = urban,
	["33"] = urban,
	["34"] = urban,
	["35"] = urban,
	["36"] = tertiary,
	["37"] = tertiary,
	["38"] = tertiary,
	["39"] = tertiary,
	["40"] = tertiary,
	["41"] = tertiary,
	["42"] = tertiary,
	["47"] = tertiary,
	["52"] = {"PR toll roads.svg", primary},
	["53"] = {"PR toll roads.svg", primary},
	["54R"] = urban,
	["63"] = urban,
	["64"] = tertiary,
	["65"] = urban,
	["66"] = {"PR toll roads.svg", primary},
	["101"] = {secondary, tertiary},
}

PR.PR = {
	shield = primary,
	shieldmain = shieldmain,
	name = "Highway %route%",
	link = "Puerto Rico Highway %route% [dab||(%dab%)|]",
	abbr = "PR-%route%",
	width = "expand",
	translation = "Ruta %route%",
	lang = "es"
}

PR.Urban = {
	shield = urban
}

PR.Sec = {
	shield = {
		ifexists = true,
		default = secondary,
		otherwise = {
			hook = "splitlen",
			split = 3,
			above = "CR %route% jct wide.svg",
			below = "CR %route% jct.svg"
		}
	}
}
	

PR.Ter = {
	shield = tertiary
}

for k, v in pairs(PR) do if k:find ("^%a") then 
	v.name = PR.PR.name
	v.link = PR.PR.link
	v.abbr = PR.PR.abbr
	v.width = PR.PR.width
	v.translation = PR.PR.translation
	v.lang = PR.PR.lang
	end
end

for _,type in ipairs({'PR', 'Urban', 'Sec', 'Ter'}) do
	for _,auxType in ipairs({"Spur"}) do
		local spec = PR[" aux "][auxType]
		PR[type .. "-" .. auxType] = {
			shield = PR[type].shield,
			shieldmain = PR[type].shield,
			name = PR[type].name .. " Spur",
			link = PR[type].link .. " Spur" .. suffix,
			abbr = PR[type].abbr .. " Spur",
			banner = "Spur plate (es).svg",
			aux = spec.aux,
			width = PR[type].width,
			translation = "Ruta %route% Ramal",
			lang = "es"
		}
	end
end

PR["PR-Spur"].banner = "Spur plate blue (es).svg"
PR["Sec-Spur"].banner = "Spur plate county (es).svg"
PR["PR-Ramal"] = PR["PR-Spur"]	
PR["Urban-Ramal"] = PR["Urban-Spur"]
PR["Sec-Ramal"] = PR["Sec-Spur"]
PR["Ter-Ramal"] = PR["Ter-Spur"]

-- add new types above this line if you want it to have the state highway browse and maint
for k, v in pairs(PR) do if k:find ("^%a") then
	v.maint = "[[Puerto Rico Department of Transportation and Public Works|Puerto Rico DTPW]]"
	end
end

return PR