Module:etymology/templates/descendant: Difference between revisions

no edit summary
(Created page with "local export = {} local listToSet = require("Module:table/listToSet") local rsplit = mw.text.split local error_on_no_descendants = false local function qualifier(content) if content then return '<span class="ib-brac qualifier-brac">(</span><span class="ib-content qualifier-content">' .. content .. '</span><span class="ib-brac qualifier-brac">)</span>' end end local function track(page) return require("Module:debug/track")("descendant/" .. page) end local func...")
 
No edit summary
Line 11: Line 11:
end
end
end
end
local function track(page)
return require("Module:debug/track")("descendant/" .. page)
end


local function ine(arg)
local function ine(arg)
Line 188: Line 182:
local m_languages = require("Module:languages")
local m_languages = require("Module:languages")
lang = m_languages.getByCode(lang, 1, "allow etym")
lang = m_languages.getByCode(lang, 1, "allow etym")
if lang:getCode() ~= lang:getNonEtymologicalCode() then
-- [[Special:WhatLinksHere/Template:tracking/descendant/etymological]]
track("etymological")
track("etymological/" .. lang:getCode())
end


local languageName = lang:getDisplayForm()
local languageName = lang:getDisplayForm()
Line 397: Line 385:
link = require("Module:links").full_link(termobj, nil, true)
link = require("Module:links").full_link(termobj, nil, true)
elseif termobj.ts or termobj.gloss or #termobj.genders > 0 then
elseif termobj.ts or termobj.gloss or #termobj.genders > 0 then
-- [[Special:WhatLinksHere/Template:tracking/descendant/no term]]
track("no term")
termobj.term = nil
termobj.term = nil
link = require("Module:links").full_link(termobj, nil, true)
link = require("Module:links").full_link(termobj, nil, true)
Line 405: Line 391:
:gsub("<small>%[Term%?%]</small>&nbsp;", "")
:gsub("<small>%[Term%?%]</small>&nbsp;", "")
:gsub("%[%[Category:[^%[%]]+ term requests%]%]", "")
:gsub("%[%[Category:[^%[%]]+ term requests%]%]", "")
else -- display no link at all
-- [[Special:WhatLinksHere/Template:tracking/descendant/no term or annotations]]
track("no term or annotations")
end
end
return link
return link
Line 535: Line 518:


if term and (desc_tree and not args["noalts"] or not desc_tree and args["alts"]) then
if term and (desc_tree and not args["noalts"] or not desc_tree and args["alts"]) then
-- [[Special:WhatLinksHere/Template:tracking/descendant/alts]]
track("alts")
alts = m_desctree.getAlternativeForms(lang, sc, term, id)
alts = m_desctree.getAlternativeForms(lang, sc, term, id)
else
else