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

Content deleted Content added
sync with live
m I corrected the spelling of "Canadian." WP:TYPO
 
(8 intermediate revisions by 3 users not shown)
Line 1:
--[[
v01.18: fix handling of definite article (e.g. for 'the Northwest Territories')
2.0 Resolve category redirects
 
each title consists of 3 parts
Line 39 ⟶ 40:
 
-- globals for this module
local debugging = falsetrue
local debugmsg = ""
local tableRowNum = 0
Line 55 ⟶ 56:
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local ResolveCategoryRedirect = require('Module:Resolve category redirect').rtarget
local p = {}
 
Line 91 ⟶ 93:
local function publishDebugLog()
if not debugging then
return "NOT DEBUGGING\n"
end
return "==Debugging ==\n\n" .. debugmsg .. "\n== Output ==\n"
Line 221 ⟶ 223:
debugLog(4, "No. " .. tostring(i) .. ": [" .. aProvince .. "]")
myCatName = makeCatName(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 425 ⟶ 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