Content deleted Content added
BrandonXLF (talk | contribs) No edit summary |
BrandonXLF (talk | contribs) No edit summary |
||
Line 10:
if roadInfo['pic'] then
local fileName = roadInfo['pic'][1] .. route .. roadInfo['pic'][2] -- Get filename from template
-- Override the default format with exceptions for some highways
if division == 'highway' or division == 'toll' then
highwayNumber = string.gsub(route, '%D', '')
highwayNumber = tonumber(highwayNumber)
Line 37:
end
if existingFile == '' and
if mw.title.new('File:' .. fileName).file.exists then -- Check if the fallback file exists and recoed it if it does
existingFile = existingFile
end
Line 167 ⟶ 171:
if export ~= '' then export = export .. ' ' end -- Add a NBSP after the picture if it exists
export = export .. getText(frame, route, roadInfo, args) -- Return text of road 1
if args['con'] then
export = export .. ' / ' .. getText(frame, args['con'], roadInfo, args) -- Add the text of the first concurrency
end
if args['con2'] then
export = export .. ' / ' .. getText(frame, args['con2'], roadInfo, args) -- Add the text of the
end
Line 182 ⟶ 183:
export = export .. ' / [[Trans-Canada Highway|TCH]]' -- Add the TCH text
end
end▼
local dirs = {} -- Table to store directions
if args['dir'] then
table.insert(cities, args['dir']) -- Add the primary direction
end
if args['condir'] then
table.insert(cities, args['condir']) -- Add the first concurrency direction
end
if args['condir2'] then
table.insert(cities, args['condir2']) -- Add the second concurrency direction
end
dirs = table.concat(dirs, '/') -- Concat the directions into a single string
if dirs ~= '' then
export = export .. ' – ' .. dirs -- Add the directions to the output
end
Line 191 ⟶ 211:
local cities = {} -- Table to store cities
end -- Add the first city
▲ end
end -- Add the second city
▲ end
cities = table.concat(cities, ', ') -- Concat the cities into a single string
|