词条 | Module:Jctint/AUS |
释义 | local p = {} local format = mw.ustring.format local concat = table.concat local insert = table.insert local roadDataModule = require("Module:Road data") function p._jctint(args) -- Tracked parameters local msgs = {} local trackedParams = {} for key,param in pairs(trackedParams) do if args[param] then insert(msgs, format("", key)) end end local msg if #msgs > 0 then local page = mw.title.getCurrentTitle().prefixedText -- Get transcluding page's title msg = mw.ustring.gsub(concat(msgs), "%%page%%", page) end -- Extra parameters args.country = "AUS" if args.lcspan == "3" then args.unitary = args.location_special args.unitary_align = args.lcalign args.location_special = nil elseif args.lcspan == "2" then args.indep_city_special = args.location_special args.indep_city_align = args.lcalign args.location_special = nil end -- Parameters to be renamed local paramSubst = { region_special = "state_special", regionspan = "sspan", sub1_special = "LGA", sub1_note = "LGA_note", sub1span = "LGAspan", sub2span = "lspan", unit = "km", unit2 = "km2", place = {"tunnel", "bridge"}, pspan = {"tspan", "bspan"} } -- Rename parameters. for tgt,src in pairs(paramSubst) do if type(src) == "table" then for _,param in ipairs(src) do args[tgt] = args[tgt] or args[param] args[param] = nil end else args[tgt] = args[tgt] or args[src] args[src] = nil end end -- Parameters to be removed local nilParams = {"lcalign"} -- Remove parameters. for _,param in ipairs(nilParams) do args[param] = nil end local coreModule = require("Module:Jctint/core/sandbox") return coreModule._jctint(args) .. (msg or "") end function p.jctint(frame) -- Import module function to work with passed arguments local getArgs = require('Module:Arguments').getArgs local args = getArgs(frame) return p._jctint(args) end return p 1 : Jctint template tracking category |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。