Module:Infobox road/locations
local p = {}
 
 local function countries(args, country)
     local data = {EUR = &quot;no&quot;, ASIA = &quot;no&quot;, default = &quot;yes&quot;}
     local yesOrNo = data[country] or data.default
     if yesOrNo == &quot;no&quot; then
         return args.countries
     else
         return nil
     end
 end
 
 local function regions(args, country)
     local data = {EUR = &quot;no&quot;, ESP = &quot;no&quot;, ITA = &quot;no&quot;, HRV = &quot;no&quot;, CZE = &quot;no&quot;, CAN = &quot;no&quot;, CYP = &quot;no&quot;, GRC = &quot;no&quot;, POL = &quot;no&quot;, HUN = &quot;no&quot;,
                   SVN = &quot;no&quot;, SVK = &quot;no&quot;, AUT = &quot;no&quot;, TUR = &quot;no&quot;, UKR = &quot;no&quot;, BIH = &quot;no&quot;, SRB = &quot;no&quot;, SGP = &quot;no&quot;, AUS = &quot;no&quot;, default = &quot;yes&quot;}
     local yesOrNo = data[country] or data.default
     if yesOrNo == &quot;no&quot; then
         return args.regions
     else
         return nil
     end
 end
 
 local function states(args, country)
     local data = {USA = &quot;no&quot;, IND = &quot;no&quot;, DEU = &quot;no&quot;, AUT = &quot;no&quot;, MEX = &quot;no&quot;, AUS = &quot;no&quot;, BRA = &quot;no&quot;, default = &quot;yes&quot;}
     local yesOrNo = data[country] or data.default
     if yesOrNo == &quot;no&quot; then
         return args.states
     else
         return nil
     end
 end
 
 local function provinces(args, country)
     local data = {TUR = &quot;no&quot;, THA = &quot;no&quot;, IRN = &quot;no&quot;, NLD = &quot;no&quot;, ESP = &quot;no&quot;, default = &quot;yes&quot;}
     local yesOrNo = data[country] or data.default
     if yesOrNo == &quot;no&quot; then
         return args.provinces
     else
         return nil
     end
 end
 
 local function counties(args, country)
     local counties = args.counties
     local districts = args.districts
     local municipalities = args.municipalities
     local parishes = args.parishes
     local boroughs = args.boroughs
     if counties then
         return &quot;Counties:&quot;, counties
     elseif districts then
         return &quot;Districts:&quot;, districts
     elseif municipalities then
         return &quot;Municipalities:&quot;, municipalities
     elseif parishes then
         return &quot;Parishes:&quot;, parishes
     elseif boroughs then
         return &quot;Boroughs:&quot;, boroughs
     else
         return '', nil
     end
 end
 
 local function ruralMunis(args, country)
     local label
     local province = country or ''
     if province == &quot;AB&quot; then
         label = &quot;Specialized&lt;br&gt;and rural&lt;br&gt;municipalities:&quot;
     else
         label = &quot;Rural&lt;br&gt;municipalities:&quot;
     end
     local data = {MB = &quot;no&quot;, SK = &quot;no&quot;, AB = &quot;no&quot;, default = &quot;yes&quot;}
     local yesOrNo = data[province] or data.default
     if yesOrNo == &quot;no&quot; then
         return label, args.rural_municipalities
     else
         return '', nil
     end
 end
 
 local function divisions(args, country)
     local province = country or ''
     local data = {ON = &quot;no&quot;, default = &quot;yes&quot;}
     local yesOrNo = data[province] or data.default
     if yesOrNo == &quot;no&quot; then
         return args.divisions
     else
         return nil
     end
 end
 
 local function cities(args, country, parameter)
     local data = {USA = &quot;yes&quot;, default = &quot;no&quot;}
     local yesOrNo = data[country] or data.default
     if yesOrNo == &quot;no&quot; then
         return args[parameter]
     else
         return nil
     end
 end
 
 local function destinations(args, country)
     local label
     if country == &quot;GBR&quot; then
         label = &quot;முதன்மை&lt;br&gt;இலக்குகள்:&quot;
     else
         label = &quot;முதன்மை&lt;br&gt;இலக்குகள்:&quot;
     end
     local data = {AUS = &quot;no&quot;, NZL = &quot;no&quot;, GBR = &quot;no&quot;, IRL = &quot;no&quot;, MYS = &quot;no&quot;, IND = &quot;no&quot;, NPL = &quot;no&quot;, default = &quot;yes&quot;}
     local yesOrNo = data[country] or data.default
     if yesOrNo == &quot;no&quot; then
         return label, args.destinations
     else
         return '', nil
     end
 end
 
 local function lga(args, country)
     local labels = {SA = &quot;[[Local government areas of South Australia|LGA(s)]]&quot;, VIC = &quot;[[Local government in Victoria|LGA(s)]]&quot;, NSW = &quot;[[Local government areas of New South Wales|LGA(s)]]&quot;,
                     QLD = &quot;[[Local government areas of Queensland|LGA(s)]]&quot;, NT = &quot;[[Local government areas of the Northern Territory|LGA(s)]]&quot;,
                     WA = &quot;[[Local government areas of Western Australia|LGA(s)]]&quot;, TAS = &quot;[[Local government areas of Tasmania|LGA(s)]]&quot;, ACT = &quot;District(s)&quot;}
     local data = {AUS = &quot;no&quot;, default = &quot;yes&quot;}
     local yesOrNo = data[country] or data.default
     if yesOrNo == &quot;no&quot; then
         local state = args.state or ''
         local label = labels[state] or &quot;[[Local government in Australia|LGA(s)]]&quot;
         return label, args.lga
     else
         return '', nil
     end
 end
 
 local function locations(args, country)
     local labels = {highway = &quot;Major settlements:&quot;, [&quot;rural road&quot;] = &quot;Major settlements:&quot;, freeway = &quot;Major suburbs:&quot;, [&quot;city highway&quot;] = &quot;Major suburbs:&quot;, road = &quot;Major suburbs:&quot;, street = &quot;Suburb:&quot;}
     local data = {AUS = &quot;no&quot;, default = &quot;yes&quot;}
     local yesOrNo = data[country] or data.default
     if yesOrNo == &quot;no&quot; then
         local type = args.type or ''
         local label = labels[type] or &quot;Primary&lt;br&gt;destinations:&quot;
         return label, args.locations
     else
         return '', nil
     end
 end
 
 function p.locations(frame)
     local pframe = frame:getParent()
     local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
     local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template
     
     local parameters = {label1 = &quot;நாடுகள்:&quot;, label2 = &quot;பிராந்தியங்கள்:&quot;, label3 = &quot;மாநிலங்கள்:&quot;, label4 = &quot;மாகாணங்கள்:&quot;, label7 = &quot;பிரிவுகள்:&quot;, label8 = &quot;முக்கிய நகரங்கள்:&quot;,
                         label9 = &quot;ஊர்கள்:&quot;, label10 = &quot;கிராமங்கள்:&quot;, child = &quot;yes&quot;, decat = &quot;yes&quot;, labelstyle = &quot;text-align:right&quot;, title = &quot;அமைவிடம்&quot;}
     local data = {}
     
     local function emptyParam(param)
         if param == '' then
             return nil
         else
             return param
         end
     end
 
     local country = emptyParam(args.country)
     local state = emptyParam(args.state)
     local province = emptyParam(args.province)
     if not(country) then
         local stateParam = args.state or args.province
         if not(stateParam) then
             country = ''
         else
             local countryMask = require &quot;Module:Infobox road/meta/mask/country&quot;
             country = countryMask._country(stateParam, country)
         end
     end
     data[1] = countries(args, country)
     data[2] = regions(args, country)
     data[3] = states(args, country)
     data[4] = provinces(args, country)
     parameters.label5, data[5] = counties(args, country)
     parameters.label6, data[6] = ruralMunis(args, province)
     data[7] = divisions(args, province)
     data[8] = cities(args, country, 'cities')
     data[9] = cities(args, country, 'towns')
     data[10] = cities(args, country, 'villages')
     parameters.label11, data[11] = destinations(args, country)
     parameters.label12, data[12] = lga(args, country)
     parameters.label13, data[13] = locations(args, country)
     
     local hasData = false
     for k,v in pairs(data) do
         if v ~= '' then
             hasData = true
             break
         end
     end
     if not(hasData) then
         return ''
     end
     
     for k,v in pairs(data) do
         parameters[&quot;data&quot; .. k] = v
     end
     
     local infoboxModule = require 'Module:Infobox'
     return infoboxModule.infobox(parameters)
 end