Module:Canada by province category navigation/sandbox: Difference between revisions

Content deleted Content added
tweak
m I corrected the spelling of "Canadian." WP:TYPO
 
(6 intermediate revisions by 3 users not shown)
Line 40:
 
-- globals for this module
local debugging = falsetrue
local debugmsg = ""
local tableRowNum = 0
Line 56:
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local ResolveCategoryRedirect = require('Module:Resolve category redirect').rtarget
local p = {}
 
Line 93:
local function publishDebugLog()
if not debugging then
return "NOT DEBUGGING\n"
end
return "==Debugging ==\n\n" .. debugmsg .. "\n== Output ==\n"
Line 222:
for i, aProvince in ipairs(provinceList) do
debugLog(4, "No. " .. tostring(i) .. ": [" .. aProvince .. "]")
myCatName = makeCatName(ResolveCategoryRedirect(aProvince, title_prefix, title_suffix))
myResolvedCatName = ResolveCategoryRedirect(makeCatName(aProvince, title_prefix, title_suffix))
debugLog(5, myCatName .. "--> " ..myResolvedCatName)
table.insert(list_args, makeCatLink(myCatName, aProvince))
end
Line 427 ⟶ 429:
-- some error parsing the title, so don't proceed to output
local trackingCatInvalid = "[[Category:" .. templateName .. " on invalid category]]"
return makeErrorMsg('the name of this category does not include a valid CandianCanadian province or territory') .. publishDebugLog() .. trackingCatInvalid
end