Module:descendants tree: Difference between revisions

No edit summary
No edit summary
 
Line 5: Line 5:


local remove_comments = require(string_utilities_module).remove_comments
local remove_comments = require(string_utilities_module).remove_comments
local function track(page)
--[[Special:WhatLinksHere/Wiktionary:Tracking/descendants tree/PAGE]]
return require("Module:debug/track")("descendants tree/" .. page)
end




Line 15: Line 10:
mw.log("Could not retrieve " .. what .. " for " .. language_name .. " in the entry [["
mw.log("Could not retrieve " .. what .. " for " .. language_name .. " in the entry [["
.. entry_name .. "]]: " .. reason .. ".")
.. entry_name .. "]]: " .. reason .. ".")
track(what .. " error")
end
end


Line 74: Line 68:
-- FIXME, should be an error
-- FIXME, should be an error
alt_form_error("nonexistent page")
alt_form_error("nonexistent page")
track("alts-nonexistent-page")
return ""
return ""
end
end
Line 84: Line 77:
-- FIXME, should be an error
-- FIXME, should be an error
alt_form_error("L2 header for language not found")
alt_form_error("L2 header for language not found")
track("alts-lang-not-found")
return ""
return ""
end
end
Line 102: Line 94:
-- FIXME, should be an error
-- FIXME, should be an error
alt_form_error("'Alternative forms' section for language not found")
alt_form_error("'Alternative forms' section for language not found")
track("alts-section-not-found")
return ""
return ""
end
end
Line 111: Line 102:
-- FIXME, should be an error
-- FIXME, should be an error
alt_form_error("no 'alt' or 'alter' template in 'Alternative forms' section for language")
alt_form_error("no 'alt' or 'alter' template in 'Alternative forms' section for language")
track("alts-alter-not-found")
return ""
return ""
end
end
Line 137: Line 127:
-- FIXME, should be an error
-- FIXME, should be an error
alt_form_error("no terms in 'alt' or 'alter' template in 'Alternative forms' section for language")
alt_form_error("no terms in 'alt' or 'alter' template in 'Alternative forms' section for language")
track("alts-no-terms-in-alter")
return ""
return ""
end
end
Line 156: Line 145:
-- FIXME, should be an error
-- FIXME, should be an error
desc_error("nonexistent page")
desc_error("nonexistent page")
track("desctree-nonexistent-page")
return ""
return ""
end
end
Line 183: Line 171:
desc_error("L2 header for language not found")
desc_error("L2 header for language not found")
-- FIXME, should be an error
-- FIXME, should be an error
track("desctree-lang-not-found")
return ""
return ""
end
end
Line 196: Line 183:
local function desctree_no_descendants(with_lang_in_error)
local function desctree_no_descendants(with_lang_in_error)
if noerror and (namespace == "" or namespace == "Reconstruction") then
if noerror and (namespace == "" or namespace == "Reconstruction") then
track("desctree-no-descendants")
return "<small class=\"error previewonly\">(" ..
return "<small class=\"error previewonly\">(" ..
"Please either change this template to {{desc}} " ..
"Please either change this template to {{desc}} " ..