Jump to content

Module:Road data/strings/MYS

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Fredddie (talk | contribs) at 15:47, 26 December 2022 (fixed). 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, 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"]`.
]==]

-- MYSna
local MYS = {}

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

MYS.E = {
	shield = "Mes-e%route%.svg",
	shieldmain = {"Expressway logo.png", "Mes-e%route%.svg"},
	name = "Expressway %route%",
	link = "Malaysia Expressway %route%",
	abbr = "E%route%",
	color = "MUTCDgreen"
}
		   
MYS.Federal = {
	shield = "Jkr-ft%route%.png",
	name = "Federal Route %route%",
	link = "Malaysia Federal Route %route%",
	abbr = "FR %route%"
}
MYS.FR = MYS.Federal

local stateRoute = {
	arg = "type",
	Perak = "A",
	Selangor = "B",
	Pahang = "C",
	Kelantan = "D",
	Johor = "J",
	Kedah = "K",
	Melacca = "M",
	["Negeri Sembilan"] = "N",
	Penang = "P",
	Perlis = "R",
	Sabah = "SA",
	Terengganu = "T",
	["Kuala Lumpur"] = "W",
	Sarawak = "Q",
	Labuan = "L",
}

for _,type in ipairs({"Johor", "Kedah", "Kelantan", "Kuala Lumpur", "Labuan", "Melaka", "Negeri Sembilan", "Pahang", "Penang", "Perak", "Perlis", "Sabah", "Sarawak", "Selangor", "Terrengganu"}) do
	MYS[type] = {
		shield = "",
		name = type .. " Route " .. tostring(stateRoute) .. "%route%",
		link = {
			ifexists = true,
			default = type .. " Route " .. tostring(stateRoute) .. "%route%",
		},
		abbr = tostring(stateRoute) .. " %route%"
	}
end

return MYS