localp={}localgetArgs=require('Module:Arguments').getArgslocalutil=require("Module:Road data/util")localyesno=require('Module:Yesno')localrouteModule=require("Module:Infobox road/route")localparserModule=require("Module:Road data/parser")localparser=parserModule.parserlocalformat=mw.ustring.formatlocalframe=mw.getCurrentFrame()localfunctioncountry(args)localstate=args.stateorargs.provincelocalcountrylocalcountryModule=mw.loadData("Module:Road data/countrymask")localcountry=args.countryorcountryModule[state]returncountryendlocalfunctioncountries(args)ifnotcountry(args)thenifargs.countriesthenreturn"no"endelseifcountry(args)=='EUR'orcountry(args)=='AFRICA'orcountry(args)=='ASIA'orcountry(args)=='SAD'thenifargs.countriesthenreturn"no"endendendlocalfunctionstates(args)ifcountry(args)=='BRA'orcountry(args)=='MEX'thenifargs.areasorargs.boroughorargs.boroughsorargs.cantonsorargs.communesorargs.communitiesorargs.countriesorargs.countyorargs.departmentsorargs.districtsorargs.divisionsorargs.federal_citiesorargs.governoratesorargs.indep_cityorargs.indep_citiesorargs.islandorargs.kraisorargs.label1orargs.label2orargs.label3orargs.label4orargs.label5orargs.lgaorargs.location1orargs.location2orargs.location3orargs.location4orargs.location5orargs.locationsorargs.municipalityorargs.oblastsorargs.okrugsorargs.parishorargs.parishesorargs.prefecturesorargs.provincesorargs.regionsorargs.republicsorargs.rural_municipalitiesorargs.sheadingsorargs.subcountiesorargs.subprefecturesorargs.subregionsorargs.territoriesthenreturn"yes"elsereturn"no"endendendlocalfunctionaustralia(args)ifcountry(args)=='AUS'thenifargs.areasorargs.boroughorargs.boroughsorargs.cantonsorargs.communesorargs.communitiesorargs.countiesorargs.countriesorargs.countyorargs.departmentsorargs.districtsorargs.divisionsorargs.federal_citiesorargs.governoratesorargs.indep_cityorargs.indep_citiesorargs.islandorargs.kraisorargs.label1orargs.label2orargs.label3orargs.label4orargs.label5orargs.location1orargs.location2orargs.location3orargs.location4orargs.location5orargs.municipalitiesorargs.municipalityorargs.oblastsorargs.okrugsorargs.parishorargs.parishesorargs.prefecturesorargs.provincesorargs.regionsorargs.republicsorargs.rural_municipalitiesorargs.sheadingsorargs.subcountiesorargs.subprefecturesorargs.subregionsorargs.territoriesthenreturn"yes"elsereturn"no"endendendlocalfunctioncanada(args)ifcountry(args)=='CAN'thenifargs.boroughorargs.boroughsorargs.cantonsorargs.communesorargs.countriesorargs.departmentsorargs.federal_citiesorargs.governoratesorargs.indep_cityorargs.indep_citiesorargs.islandorargs.kraisorargs.label1orargs.label2orargs.label3orargs.label4orargs.label5orargs.lgaorargs.location1orargs.location2orargs.location3orargs.location4orargs.location5orargs.locationsorargs.oblastsorargs.okrugsorargs.prefecturesorargs.republicsorargs.sheadingsorargs.statesorargs.subcountiesorargs.subprefecturesorargs.subregionsthenreturn"yes"elsereturn"no"endendendlocalfunctionchina(args)ifcountry(args)=='CHN'thenifargs.areasorargs.boroughorargs.boroughsorargs.cantonsorargs.communesorargs.communitiesorargs.countriesorargs.departmentsorargs.divisionsorargs.federal_citiesorargs.governoratesorargs.indep_cityorargs.indep_citiesorargs.islandorargs.kraisorargs.label1orargs.label2orargs.label3orargs.label4orargs.label5orargs.lgaorargs.location1orargs.location2orargs.location3orargs.location4orargs.location5orargs.locationsorargs.municipalitiesorargs.municipalityorargs.oblastsorargs.okrugsorargs.parishorargs.parishesorargs.prefecturesorargs.republicsorargs.rural_municipalitiesorargs.sheadingsorargs.statesorargs.subcountiesorargs.subprefecturesorargs.subregionsorargs.territoriesthenreturn"yes"elsereturn"no"endendendlocalfunctionfrance(args)ifcountry(args)=='FRA'thenifargs.areasorargs.boroughorargs.boroughsorargs.cantonsorargs.communesorargs.communitiesorargs.countiesorargs.countriesorargs.countyorargs.districtsorargs.divisionsorargs.federal_citiesorargs.governoratesorargs.indep_cityorargs.indep_citiesorargs.islandorargs.kraisorargs.label1orargs.label2orargs.label3orargs.label4orargs.label5orargs.lgaorargs.location1orargs.location2orargs.location3orargs.location4orargs.location5orargs.locationsorargs.municipalitiesorargs.municipalityorargs.oblastsorargs.okrugsorargs.parishorargs.parishesorargs.prefecturesorargs.provincesorargs.republicsorargs.rural_municipalitiesorargs.sheadingsorargs.statesorargs.subcountiesorargs.subprefecturesorargs.subregionsorargs.territoriesthenreturn"yes"elsereturn"no"endendendlocalfunctionindia(args)ifcountry(args)=='IND'thenifargs.areasorargs.boroughorargs.boroughsorargs.cantonsorargs.communesorargs.communitiesorargs.countiesorargs.countriesorargs.countyorargs.departmentsorargs.divisionsorargs.federal_citiesorargs.governoratesorargs.indep_cityorargs.indep_citiesorargs.islandorargs.kraisorargs.label1orargs.label2orargs.label3orargs.label4orargs.label5orargs.lgaorargs.location1orargs.location2orargs.location3orargs.location4orargs.location5orargs.locationsorargs.oblastsorargs.okrugsorargs.parishorargs.parishesorargs.prefecturesorargs.provincesorargs.regionsorargs.republicsorargs.rural_municipalitiesorargs.sheadingsorargs.subcountiesorargs.subprefecturesorargs.subregionsthenreturn"yes"elsereturn"no"endendendlocalfunctionnetherlands(args)ifcountry(args)=='NLD'thenifargs.areasorargs.boroughorargs.boroughsorargs.cantonsorargs.communesorargs.communitiesorargs.countiesorargs.countriesorargs.countyorargs.departmentsorargs.districtsorargs.divisionsorargs.federal_citiesorargs.governoratesorargs.indep_cityorargs.indep_citiesorargs.islandorargs.kraisorargs.label1orargs.label2orargs.label3orargs.label4orargs.label5orargs.lgaorargs.location1orargs.location2orargs.location3orargs.location4orargs.location5orargs.locationsorargs.oblastsorargs.okrugsorargs.parishorargs.parishesorargs.prefecturesorargs.regionsorargs.republicsorargs.rural_municipalitiesorargs.sheadingsorargs.statesorargs.subcountiesorargs.subprefecturesorargs.subregionsorargs.territoriesthenreturn"yes"elsereturn"no"endendendlocalfunctionrussia(args)ifcountry(args)=='RUS'thenifargs.areasorargs.boroughorargs.boroughsorargs.cantonsorargs.communesorargs.communitiesorargs.countiesorargs.countriesorargs.countyorargs.departmentsorargs.districtsorargs.divisionsorargs.governoratesorargs.indep_cityorargs.indep_citiesorargs.islandorargs.label1orargs.label2orargs.label3orargs.label4orargs.label5orargs.lgaorargs.location1orargs.location2orargs.location3orargs.location4orargs.location5orargs.locationsorargs.municipalitiesorargs.municipalityorargs.parishorargs.parishesorargs.prefecturesorargs.provincesorargs.regionsorargs.rural_municipalitiesorargs.sheadingsorargs.statesorargs.subcountiesorargs.subprefecturesorargs.subregionsorargs.territoriesthenreturn"yes"elsereturn"no"endendendlocalfunctionspain(args)ifcountry(args)=='ESP'thenifargs.areasorargs.boroughorargs.boroughsorargs.cantonsorargs.communesorargs.countiesorargs.countriesorargs.countyorargs.departmentsorargs.districtsorargs.divisionsorargs.federal_citiesorargs.governoratesorargs.indep_cityorargs.indep_citiesorargs.islandorargs.kraisorargs.label1orargs.label2orargs.label3orargs.label4orargs.label5orargs.lgaorargs.location1orargs.location2orargs.location3orargs.location4orargs.location5orargs.locationsorargs.municipalitiesorargs.municipalityorargs.oblastsorargs.okrugsorargs.parishorargs.parishesorargs.prefecturesorargs.regionsorargs.republicsorargs.rural_municipalitiesorargs.sheadingsorargs.statesorargs.subcountiesorargs.subprefecturesorargs.subregionsorargs.territoriesthenreturn"yes"elsereturn"no"endendendlocalfunctionunitedKingdom(args)ifcountry(args)=='GBR'thenifargs.boroughorargs.cantonsorargs.communesorargs.communitiesorargs.countriesorargs.countyorargs.departmentsorargs.divisionsorargs.federal_citiesorargs.governoratesorargs.indep_cityorargs.indep_citiesorargs.kraisorargs.label1orargs.label2orargs.label3orargs.label4orargs.label5orargs.lgaorargs.location1orargs.location2orargs.location3orargs.location4orargs.location5orargs.locationsorargs.municipalitiesorargs.municipalityorargs.oblastsorargs.okrugsorargs.parishorargs.prefecturesorargs.provincesorargs.regionsorargs.republicsorargs.rural_municipalitiesorargs.statesorargs.subcountiesorargs.subprefecturesorargs.subregionsorargs.territoriesthenreturn"yes"elsereturn"no"endendendlocalfunctionunitedStates(args)ifcountry(args)=='USA'thenifargs.areasorargs.cantonsorargs.citiesorargs.communesorargs.communitiesorargs.countriesorargs.departmentsorargs.destinationsorargs.districtsorargs.divisionsorargs.federal_citiesorargs.governoratesorargs.islandorargs.kraisorargs.label1orargs.label2orargs.label3orargs.label4orargs.label5orargs.lgaorargs.location1orargs.location2orargs.location3orargs.location4orargs.location5orargs.locationsorargs.oblastsorargs.okrugsorargs.photoorargs.prefecturesorargs.provincesorargs.regionsorargs.republicsorargs.rural_municipalitiesorargs.sheadingsorargs.subcountiesorargs.subprefecturesorargs.subregionsorargs.territoriesorargs.townsorargs.villagesthenreturn"yes"elsereturn"no"endendendlocalfunctiontrigger(args)ifcountries(args)=='yes'orstates(args)=='yes'oraustralia(args)=='yes'orcanada(args)=='yes'orchina(args)=='yes'orfrance(args)=='yes'orindia(args)=='yes'ornetherlands(args)=='yes'orrussia(args)=='yes'orspain(args)=='yes'orunitedKingdom(args)=='yes'orunitedStates(args)=='yes'thenreturntrueelsereturnfalseendendfunctionp.errors(frame)localargs=getArgs(frame)localpagename=frame:getTitle()iftrigger(args)==truethenreturnstring.format("[[Category:Infobox road transclusion errors|%% %s]]",pagename)elsereturnnilendendreturnp--args.areas or args.borough or args.boroughs or args.cantons or args.communes or args.communities or args.counties or args.countries or args.county or args.departments or args.districts or args.divisions or args.federal_cities or args.governorates or args.indep_city or args.indep_cities or args.island or args.krais or args.label1 or args.label2 or args.label3 or args.label4 or args.label5 or args.lga or args.location1 or args.location2 or args.location3 or args.location4 or args.location5 or args.locations or args.municipalities or args.municipality or args.oblasts or args.okrugs or args.parish or args.parishes or args.prefectures or args.provinces or args.regions or args.republics or args.rural_municipalities or args.sheadings or args.states or args.subcounties or args.subprefectures or args.subregions or args.territories then