<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tes5.st34an.tech/index.php?action=history&amp;feed=atom&amp;title=Module%3ACategory_tree%2Ftopic_cat</id>
	<title>Module:Category tree/topic cat - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tes5.st34an.tech/index.php?action=history&amp;feed=atom&amp;title=Module%3ACategory_tree%2Ftopic_cat"/>
	<link rel="alternate" type="text/html" href="https://tes5.st34an.tech/index.php?title=Module:Category_tree/topic_cat&amp;action=history"/>
	<updated>2026-04-17T18:41:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://tes5.st34an.tech/index.php?title=Module:Category_tree/topic_cat&amp;diff=877&amp;oldid=prev</id>
		<title>Jsrs701: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://tes5.st34an.tech/index.php?title=Module:Category_tree/topic_cat&amp;diff=877&amp;oldid=prev"/>
		<updated>2026-04-15T08:10:36Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:10, 15 April 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key mediawikidb:diff:1.41:old-876:rev-877 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jsrs701</name></author>
	</entry>
	<entry>
		<id>https://tes5.st34an.tech/index.php?title=Module:Category_tree/topic_cat&amp;diff=876&amp;oldid=prev</id>
		<title>Bob&gt;Juelos at 10:42, 25 August 2024</title>
		<link rel="alternate" type="text/html" href="https://tes5.st34an.tech/index.php?title=Module:Category_tree/topic_cat&amp;diff=876&amp;oldid=prev"/>
		<updated>2024-08-25T10:42:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local export = {}&lt;br /&gt;
&lt;br /&gt;
local label_data = require(&amp;quot;Module:category tree/topic cat/data&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local rsplit = mw.text.split&lt;br /&gt;
&lt;br /&gt;
-- Category object&lt;br /&gt;
&lt;br /&gt;
local Category = {}&lt;br /&gt;
Category.__index = Category&lt;br /&gt;
&lt;br /&gt;
function Category.new_main(frame)&lt;br /&gt;
	local self = setmetatable({}, Category)&lt;br /&gt;
	&lt;br /&gt;
	local params = {&lt;br /&gt;
		[1] = {},&lt;br /&gt;
		[2] = {required = true},&lt;br /&gt;
		[&amp;quot;sc&amp;quot;] = {},&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	args = require(&amp;quot;Module:parameters&amp;quot;).process(frame:getParent().args, params, nil, &amp;quot;category tree/topic cat&amp;quot;, &amp;quot;new_main&amp;quot;)&lt;br /&gt;
	self._info = {code = args[1], label = args[2]}&lt;br /&gt;
	&lt;br /&gt;
	self:initCommon()&lt;br /&gt;
	&lt;br /&gt;
	if not self._data then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return self&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Category.new(info)&lt;br /&gt;
	for key, val in pairs(info) do&lt;br /&gt;
		if not (key == &amp;quot;code&amp;quot; or key == &amp;quot;label&amp;quot;) then&lt;br /&gt;
			error(&amp;quot;The parameter “&amp;quot; .. key .. &amp;quot;” was not recognized.&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local self = setmetatable({}, Category)&lt;br /&gt;
	self._info = info&lt;br /&gt;
	&lt;br /&gt;
	if not self._info.label then&lt;br /&gt;
		error(&amp;quot;No label was specified.&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	self:initCommon()&lt;br /&gt;
	&lt;br /&gt;
	if not self._data then&lt;br /&gt;
		error(&amp;quot;The label “&amp;quot; .. self._info.label .. &amp;quot;” does not exist.&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return self&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
export.new = Category.new&lt;br /&gt;
export.new_main = Category.new_main&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:initCommon()&lt;br /&gt;
	if self._info.code then&lt;br /&gt;
		if self._info.code == &amp;quot;Rhymes&amp;quot; then&lt;br /&gt;
		else&lt;br /&gt;
		-- Convert language code to lowercase if possible&lt;br /&gt;
		local lowercase_code = mw.ustring.lower(self._info.code)&lt;br /&gt;
		&lt;br /&gt;
		self._lang = require(&amp;quot;Module:languages&amp;quot;).getByCode(lowercase_code) or&lt;br /&gt;
			error(&amp;quot;The language code “&amp;quot; .. lowercase_code .. &amp;quot;” is not valid.&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Convert label to lowercase if possible&lt;br /&gt;
	local lowercase_label = mw.getContentLanguage():lcfirst(self._info.label)&lt;br /&gt;
	&lt;br /&gt;
	-- Check if the label exists&lt;br /&gt;
	local labels = label_data[&amp;quot;LABELS&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
	if labels[lowercase_label] then&lt;br /&gt;
		self._info.label = lowercase_label&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	self._data = labels[self._info.label]&lt;br /&gt;
	&lt;br /&gt;
	-- Go through handlers&lt;br /&gt;
	if not self._data then&lt;br /&gt;
		for _, handler in ipairs(label_data[&amp;quot;HANDLERS&amp;quot;]) do&lt;br /&gt;
			self._data = handler.handler(self._info.label)&lt;br /&gt;
			if self._data then&lt;br /&gt;
				self._data.module = handler.module&lt;br /&gt;
				break&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:getInfo()&lt;br /&gt;
	return self._info&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:getBreadcrumbName()&lt;br /&gt;
	local ret&lt;br /&gt;
&lt;br /&gt;
	if self._lang or self._info.raw then&lt;br /&gt;
		ret = self._data.breadcrumb&lt;br /&gt;
	else&lt;br /&gt;
		-- FIXME, copied from [[Module:category tree/poscatboiler]]. No support for specific umbrella info yet.&lt;br /&gt;
		ret = self._data.umbrella and self._data.umbrella.breadcrumb&lt;br /&gt;
	end&lt;br /&gt;
	if not ret then&lt;br /&gt;
		ret = self._info.label&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if type(ret) == &amp;quot;string&amp;quot; or type(ret) == &amp;quot;number&amp;quot; then&lt;br /&gt;
		ret = {name = ret}&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local name = self:substitute_template_specs(ret.name)&lt;br /&gt;
	local nocap = ret.nocap&lt;br /&gt;
&lt;br /&gt;
	return name, nocap&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:getDataModule()&lt;br /&gt;
	return self._data.module&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:canBeEmpty()&lt;br /&gt;
	if self._lang then&lt;br /&gt;
		return false&lt;br /&gt;
	else&lt;br /&gt;
		return true&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:isHidden()&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:getCategoryName()&lt;br /&gt;
	if self._lang then&lt;br /&gt;
		return self._lang:getCode() .. &amp;quot;:&amp;quot; .. mw.getContentLanguage():ucfirst(self._info.label)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.getContentLanguage():ucfirst(self._info.label)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function replace_special_descriptions(desc)&lt;br /&gt;
	-- TODO: Should probably find a better way to do this&lt;br /&gt;
	local descriptionFormats = {&lt;br /&gt;
		[&amp;quot;default&amp;quot;]					= &amp;quot;{{{langname}}} terms related to {{{label_lc}}}.&amp;quot;,&lt;br /&gt;
		[&amp;quot;default with capital&amp;quot;]	= &amp;quot;{{{langname}}} terms related to {{{label_uc}}}.&amp;quot;,&lt;br /&gt;
		[&amp;quot;default with the&amp;quot;]		= &amp;quot;{{{langname}}} terms related to the {{{label_uc}}}.&amp;quot;,&lt;br /&gt;
		[&amp;quot;default with the lower&amp;quot;]	= &amp;quot;{{{langname}}} terms related to the {{{label_lc}}}.&amp;quot;,&lt;br /&gt;
		[&amp;quot;default with topic&amp;quot;]		= &amp;quot;{{{langname}}} terms related to {{{label_lc}}} topics.&amp;quot;,&lt;br /&gt;
		[&amp;quot;default with topic capital&amp;quot;] = &amp;quot;{{{langname}}} terms related to {{{label_uc}}} topics.&amp;quot;,&lt;br /&gt;
		[&amp;quot;default-set&amp;quot;]				= &amp;quot;{{{langname}}} terms for various {{{label_lc}}}.&amp;quot;,&lt;br /&gt;
		[&amp;quot;default-set capital&amp;quot;]		= &amp;quot;{{{langname}}} terms for various {{{label_uc}}}.&amp;quot;,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	if descriptionFormats[desc] then&lt;br /&gt;
		return descriptionFormats[desc]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if desc then&lt;br /&gt;
		local stripped_desc = desc&lt;br /&gt;
		local no_singularize, wikify&lt;br /&gt;
		while true do&lt;br /&gt;
			local new_stripped_desc = stripped_desc:match(&amp;quot;^(.+) no singularize$&amp;quot;)&lt;br /&gt;
			if new_stripped_desc then&lt;br /&gt;
				stripped_desc = new_stripped_desc&lt;br /&gt;
				no_singularize = true&lt;br /&gt;
			else&lt;br /&gt;
				new_stripped_desc = stripped_desc:match(&amp;quot;^(.+) wikify$&amp;quot;)&lt;br /&gt;
				if new_stripped_desc then&lt;br /&gt;
					stripped_desc = new_stripped_desc&lt;br /&gt;
					wikify = true&lt;br /&gt;
				else&lt;br /&gt;
					break&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if descriptionFormats[stripped_desc] then&lt;br /&gt;
			local repl_suf = &amp;quot;%1&amp;quot;&lt;br /&gt;
			if wikify then&lt;br /&gt;
				repl_suf = repl_suf .. &amp;quot;_wiki&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
			if no_singularize then&lt;br /&gt;
				repl_suf = repl_suf .. &amp;quot;_no_sing&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
			return descriptionFormats[stripped_desc]:gsub(&amp;quot;({{{label_[ul]c)}}}&amp;quot;, repl_suf ..&amp;quot;}}}&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return desc&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:substitute_template_specs(desc)&lt;br /&gt;
	if not desc then&lt;br /&gt;
		return desc&lt;br /&gt;
	end&lt;br /&gt;
	if type(desc) == &amp;quot;number&amp;quot; then&lt;br /&gt;
		desc = tostring(desc)&lt;br /&gt;
	end&lt;br /&gt;
	-- FIXME, when does this occur? It doesn&amp;#039;t occur in the corresponding place in [[Module:category tree/poscatboiler]].&lt;br /&gt;
	if type(desc) ~= &amp;quot;string&amp;quot; then&lt;br /&gt;
		return desc&lt;br /&gt;
	end&lt;br /&gt;
	desc = desc:gsub(&amp;quot;{{PAGENAME}}&amp;quot;, mw.title.getCurrentTitle().text)&lt;br /&gt;
	if self._lang then&lt;br /&gt;
		desc = desc:gsub(&amp;quot;{{{langname}}}&amp;quot;, self._lang:getCanonicalName())&lt;br /&gt;
		desc = desc:gsub(&amp;quot;{{{langcode}}}&amp;quot;, self._lang:getCode())&lt;br /&gt;
		desc = desc:gsub(&amp;quot;{{{langcat}}}&amp;quot;, self._lang:getCategoryName())&lt;br /&gt;
		desc = desc:gsub(&amp;quot;{{{langlink}}}&amp;quot;, self._lang:makeCategoryLink())&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function handle_label(label_sub, uclc, no_singularize, wikify)&lt;br /&gt;
		local label = self._info.label&lt;br /&gt;
		if uclc == &amp;quot;uc&amp;quot; then&lt;br /&gt;
			label = mw.getContentLanguage():ucfirst(label)&lt;br /&gt;
		elseif uclc == &amp;quot;lc&amp;quot; then&lt;br /&gt;
			label = mw.getContentLanguage():lcfirst(label)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local function term_exists(term)&lt;br /&gt;
			local title = mw.title.new(term)&lt;br /&gt;
			return title and title.exists&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local singular_label&lt;br /&gt;
		if not no_singularize then&lt;br /&gt;
			singular_label = require(&amp;quot;Module:string utilities&amp;quot;).singularize(label)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local function gsub_desc(to)&lt;br /&gt;
			return (desc:gsub(label_sub, require(&amp;quot;Module:pattern utilities&amp;quot;).replacement_escape(to)))&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if wikify then&lt;br /&gt;
			if singular_label then&lt;br /&gt;
				return gsub_desc(&amp;quot;[[Wikipedia:&amp;quot; .. singular_label .. &amp;quot;|&amp;quot; .. label .. &amp;quot;]]&amp;quot;)&lt;br /&gt;
			else&lt;br /&gt;
				return gsub_desc(&amp;quot;[[Wikipedia:&amp;quot; .. label .. &amp;quot;|&amp;quot; .. label .. &amp;quot;]]&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- First try to singularize the label as a whole, unless &amp;#039;no singularize&amp;#039; was given. If the result exists,&lt;br /&gt;
		-- return it.&lt;br /&gt;
		if singular_label and term_exists(singular_label) then&lt;br /&gt;
			return gsub_desc(&amp;quot;[[Wiktionary:&amp;quot; .. singular_label .. &amp;quot;|&amp;quot; .. label .. &amp;quot;]]&amp;quot;)&lt;br /&gt;
		elseif term_exists(label) then&lt;br /&gt;
			-- Then check if the original label as a whole exists, and return if so.&lt;br /&gt;
			return gsub_desc(&amp;quot;[[Wiktionary: &amp;quot; .. label .. &amp;quot;|&amp;quot; .. label .. &amp;quot;]]&amp;quot;)&lt;br /&gt;
		else&lt;br /&gt;
			-- Otherwise, if the label is multiword, split into words and try the link each one, singularizing the last&lt;br /&gt;
			-- one unless &amp;#039;no singularize&amp;#039; was given.&lt;br /&gt;
			local split_label&lt;br /&gt;
			if label:find(&amp;quot; &amp;quot;) then&lt;br /&gt;
				if not no_singularize then&lt;br /&gt;
					split_label = rsplit(label, &amp;quot; &amp;quot;)&lt;br /&gt;
					for i, word in ipairs(split_label) do&lt;br /&gt;
						if i == #split_label then&lt;br /&gt;
							local singular_word = require(&amp;quot;Module:string utilities&amp;quot;).singularize(word)&lt;br /&gt;
							if term_exists(singular_word) then&lt;br /&gt;
								split_label[i] = &amp;quot;[[Wiktionary:&amp;quot; .. singular_word .. &amp;quot;|&amp;quot; .. word .. &amp;quot;]]&amp;quot;&lt;br /&gt;
							else&lt;br /&gt;
								split_label = nil&lt;br /&gt;
								break&lt;br /&gt;
							end&lt;br /&gt;
						else&lt;br /&gt;
							if term_exists(word) then&lt;br /&gt;
								split_label[i] = &amp;quot;[[Wiktionary:&amp;quot; .. word .. &amp;quot;|&amp;quot; .. word .. &amp;quot;]]&amp;quot;&lt;br /&gt;
							else&lt;br /&gt;
								split_label = nil&lt;br /&gt;
								break&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
					if split_label then&lt;br /&gt;
						split_label = table.concat(split_label, &amp;quot; &amp;quot;)&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
&lt;br /&gt;
				-- If we weren&amp;#039;t able to link individual words with the last word singularized, link all words as-is.&lt;br /&gt;
				if not split_label then&lt;br /&gt;
					split_label = rsplit(label, &amp;quot; &amp;quot;)&lt;br /&gt;
					for i, word in ipairs(split_label) do&lt;br /&gt;
						if term_exists(word) then&lt;br /&gt;
							split_label[i] = &amp;quot;[[Wiktionary:&amp;quot; .. word .. &amp;quot;|&amp;quot; .. word .. &amp;quot;]]&amp;quot;&lt;br /&gt;
						else&lt;br /&gt;
							split_label = nil&lt;br /&gt;
							break&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
					if split_label then&lt;br /&gt;
						split_label = table.concat(split_label, &amp;quot; &amp;quot;)&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			if split_label then&lt;br /&gt;
				return gsub_desc(split_label)&lt;br /&gt;
			else&lt;br /&gt;
				return gsub_desc(label)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	for _, spec in ipairs {&lt;br /&gt;
		{&amp;quot;{{{label_uc}}}&amp;quot;, &amp;quot;uc&amp;quot;},&lt;br /&gt;
		{&amp;quot;{{{label_uc_no_sing}}}&amp;quot;, &amp;quot;uc&amp;quot;, &amp;quot;no singularize&amp;quot;},&lt;br /&gt;
		{&amp;quot;{{{label_lc}}}&amp;quot;, &amp;quot;lc&amp;quot;},&lt;br /&gt;
		{&amp;quot;{{{label_lc_no_sing}}}&amp;quot;, &amp;quot;lc&amp;quot;, &amp;quot;no singularize&amp;quot;},&lt;br /&gt;
		{&amp;quot;{{{label_uc_wiki}}}&amp;quot;, &amp;quot;uc&amp;quot;, false, &amp;quot;wikify&amp;quot;},&lt;br /&gt;
		{&amp;quot;{{{label_uc_wiki_no_sing}}}&amp;quot;, &amp;quot;uc&amp;quot;, &amp;quot;no singularize&amp;quot;, &amp;quot;wikify&amp;quot;},&lt;br /&gt;
		{&amp;quot;{{{label_lc_wiki}}}&amp;quot;, &amp;quot;lc&amp;quot;, false, &amp;quot;wikify&amp;quot;},&lt;br /&gt;
		{&amp;quot;{{{label_lc_wiki_no_sing}}}&amp;quot;, &amp;quot;lc&amp;quot;, &amp;quot;no singularize&amp;quot;, &amp;quot;wikify&amp;quot;},&lt;br /&gt;
	} do&lt;br /&gt;
		local label_sub, uclc, no_singularize, wikify = unpack(spec)&lt;br /&gt;
		if desc:find(label_sub) then&lt;br /&gt;
			desc = handle_label(label_sub, uclc, no_singularize, wikify)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if desc:find(&amp;quot;{&amp;quot;) then&lt;br /&gt;
		desc = mw.getCurrentFrame():preprocess(desc)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return desc&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:substitute_template_specs_in_args(args)&lt;br /&gt;
	if not args then&lt;br /&gt;
		return args&lt;br /&gt;
	end&lt;br /&gt;
	local pinfo = {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		k = self:substitute_template_specs(k)&lt;br /&gt;
		v = self:substitute_template_specs(v)&lt;br /&gt;
		pinfo[k] = v&lt;br /&gt;
	end&lt;br /&gt;
	return pinfo&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:getDisplay(isChild)&lt;br /&gt;
	if self._data[&amp;quot;display&amp;quot;] then&lt;br /&gt;
		if self._info.code then&lt;br /&gt;
			return self._info.code .. &amp;quot;:&amp;quot; .. self._data[&amp;quot;display&amp;quot;]:gsub(&amp;quot;^%l&amp;quot;, string.upper)&lt;br /&gt;
		else&lt;br /&gt;
			return self._data[&amp;quot;display&amp;quot;]&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Category:getDisplay2(isChild)&lt;br /&gt;
	if self._data[&amp;quot;display&amp;quot;] then&lt;br /&gt;
		return self._data[&amp;quot;display&amp;quot;]:gsub(&amp;quot;^%l&amp;quot;, string.upper)&lt;br /&gt;
	end&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Category:getSort(isChild)&lt;br /&gt;
	return self._data[&amp;quot;sort&amp;quot;]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Category:getDescription(isChild)&lt;br /&gt;
	-- Allows different text in the list of a category&amp;#039;s children&lt;br /&gt;
	local isChild = isChild == &amp;quot;child&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	if self._lang then&lt;br /&gt;
		local desc = self._data[&amp;quot;description&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
		desc = replace_special_descriptions(desc)&lt;br /&gt;
		if desc then&lt;br /&gt;
			if not isChild and self._data.additional then&lt;br /&gt;
				desc = desc .. &amp;quot;\n\n&amp;quot; .. self._data.additional&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			return self:substitute_template_specs(desc)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		if not self._lang and ( self._info.label == &amp;quot;all topics&amp;quot; or self._info.label == &amp;quot;all sets&amp;quot; ) then&lt;br /&gt;
			return &amp;quot;This category applies to content and not to meta material about the Wiki.&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local eninfo = mw.clone(self._info)&lt;br /&gt;
		eninfo.code = &amp;quot;en&amp;quot;&lt;br /&gt;
		local en = Category.new(eninfo)&lt;br /&gt;
&lt;br /&gt;
		local desc = self._data[&amp;quot;umbrella_description&amp;quot;] or self._data[&amp;quot;description&amp;quot;]&lt;br /&gt;
		desc = replace_special_descriptions(desc)&lt;br /&gt;
		if desc then&lt;br /&gt;
			desc = desc:gsub(&amp;quot;^{{{langname}}} &amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			desc = desc:gsub(&amp;quot;{{{langcode}}}:&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			desc = desc:gsub(&amp;quot;^{{{langcode}}} &amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			desc = desc:gsub(&amp;quot;^{{{langcat}}} &amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			desc = desc:gsub(&amp;quot;%.$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			desc = self:substitute_template_specs(desc)&lt;br /&gt;
		else&lt;br /&gt;
			desc = self._info.label&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local display = self._data[&amp;quot;display&amp;quot;] or mw.getContentLanguage():ucfirst(self._info.label)&lt;br /&gt;
		return&lt;br /&gt;
			&amp;quot;This category concerns the topic: &amp;quot; .. desc .. &amp;quot;.\n\n&amp;quot; ..&lt;br /&gt;
			&amp;quot;It contains no dictionary entries, only other categories. The subcategories are of two sorts:\n\n&amp;quot; ..&lt;br /&gt;
			&amp;quot;* Subcategories named like “aa:&amp;quot; .. display .. &amp;quot;” (with a prefixed language code) are categories of terms in specific languages. &amp;quot; ..&lt;br /&gt;
			&amp;quot;* Subcategories of this one named without the prefixed language code are further categories just like this one, but devoted to finer topics.&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:getParents()&lt;br /&gt;
	local parents = self._data[&amp;quot;parents&amp;quot;]&lt;br /&gt;
	&lt;br /&gt;
	if not self._lang and ( self._info.label == &amp;quot;all topics&amp;quot; or self._info.label == &amp;quot;all sets&amp;quot; ) then&lt;br /&gt;
		return {{ name = &amp;quot;Category:Fundamental&amp;quot;, sort = self._info.label:gsub(&amp;quot;all &amp;quot;, &amp;quot;&amp;quot;) }}&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if not parents or #parents == 0 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local is_set = false&lt;br /&gt;
	&lt;br /&gt;
	if self._info.label == &amp;quot;all sets&amp;quot; then&lt;br /&gt;
		is_set = true&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for key, parent in ipairs(parents) do&lt;br /&gt;
		parent = mw.clone(parent)&lt;br /&gt;
		&lt;br /&gt;
		if type(parent) ~= &amp;quot;table&amp;quot; then&lt;br /&gt;
			parent = {name = parent}&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if not parent.sort then&lt;br /&gt;
			parent.sort = self._info.label&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if self._lang then&lt;br /&gt;
			parent.sort = self:substitute_template_specs(parent.sort)&lt;br /&gt;
		elseif parent.sort:find(&amp;quot;{{{langname}}}&amp;quot;) or parent.sort:find(&amp;quot;{{{langcat}}}&amp;quot;) or&lt;br /&gt;
			parent.template == &amp;quot;langcatboiler&amp;quot; or parent.module then&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if not self._lang then&lt;br /&gt;
			parent.sort = &amp;quot; &amp;quot; .. parent.sort&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if parent.name and parent.name:find(&amp;quot;^Category:&amp;quot;) then&lt;br /&gt;
			if self._lang then&lt;br /&gt;
				parent.name = self:substitute_template_specs(parent.name)&lt;br /&gt;
			elseif parent.name:find(&amp;quot;{{{langname}}}&amp;quot;) or parent.name:find(&amp;quot;{{{langcat}}}&amp;quot;) or&lt;br /&gt;
				parent.template == &amp;quot;langcatboiler&amp;quot; or parent.module then&lt;br /&gt;
				return nil&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			if parent.name == &amp;quot;list of sets&amp;quot; then&lt;br /&gt;
				is_set = true&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			local pinfo = mw.clone(self._info)&lt;br /&gt;
			pinfo.label = parent.name&lt;br /&gt;
			&lt;br /&gt;
			if parent.template then&lt;br /&gt;
				parent.name = require(&amp;quot;Module:category tree/&amp;quot; .. parent.template).new(pinfo)&lt;br /&gt;
			elseif parent.module then&lt;br /&gt;
				-- A reference to a category using another category tree module.&lt;br /&gt;
				if not parent.args then&lt;br /&gt;
					error(&amp;quot;Missing .args in parent table with module=\&amp;quot;&amp;quot; .. parent.module .. &amp;quot;\&amp;quot; for &amp;#039;&amp;quot; ..&lt;br /&gt;
						self._info.label .. &amp;quot;&amp;#039; topic entry in module &amp;#039;&amp;quot; .. (self._data.module or &amp;quot;unknown&amp;quot;) .. &amp;quot;&amp;#039;&amp;quot;)&lt;br /&gt;
				end&lt;br /&gt;
				parent.name = require(&amp;quot;Module:category tree/&amp;quot; .. parent.module).new(self:substitute_template_specs_in_args(parent.args))&lt;br /&gt;
			else&lt;br /&gt;
				parent.name = Category.new(pinfo)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		table.insert(ret, parent)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if not is_set and self._info.label ~= &amp;quot;list of topics&amp;quot; and self._info.label ~= &amp;quot;list of sets&amp;quot; then&lt;br /&gt;
		local pinfo = mw.clone(self._info)&lt;br /&gt;
		pinfo.label = &amp;quot;list of topics&amp;quot;&lt;br /&gt;
		table.insert(ret, {name = Category.new(pinfo), sort = (not self._lang and &amp;quot; &amp;quot; or &amp;quot;&amp;quot;) .. self._info.label})&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:getChildren()&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:getUmbrella()&lt;br /&gt;
	if not self._lang then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local uinfo = mw.clone(self._info)&lt;br /&gt;
	uinfo.code = nil&lt;br /&gt;
	return Category.new(uinfo)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function Category:getTOCTemplateName()&lt;br /&gt;
	local lang = self._lang&lt;br /&gt;
	local code = lang and lang:getCode() or &amp;quot;en&amp;quot;&lt;br /&gt;
	return &amp;quot;Template:&amp;quot; .. code .. &amp;quot;-categoryTOC&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
return export&lt;/div&gt;</summary>
		<author><name>Bob&gt;Juelos</name></author>
	</entry>
</feed>