Difference between revisions 21306691 and 21306692 on frwiktionary

local export = {}
local m_languages = require('Module:languages')

-- The main entry point.
-- This is the only function that can be invoked from a template.
function export.show(frame)
	if mw.title.getCurrentTitle().nsText == "Template" then
		return "(This template should be used on pages in the Category: namespace.)"
(contracted; show full)	
	if not parents then
		return
	end
	
	for _, parent in ipairs(parents) do
		if type(parent.name) == "string" then
			if not (current._lang and current:getCategoryName() == mw.getContentLanguage():ucfirst(current._lang:getCategoryName())) and not (current._sc and current:getCategoryName():find(mw.getContentLanguage():ucfirst(current._sc:getCategoryName())
, true)) and current:getInfo().code then
				require("Module:debug").track("category tree/string")
			end
			
			table.insert(categories, "[[" .. parent.name .. "|" .. parent.sort .. "]]")
		else
			table.insert(categories, "[[Category:" .. parent.name:getCategoryName() .. "|" .. parent.sort .. "]]")
		end
(contracted; show full)			return mw.getCurrentFrame():expandTemplate{title = TOC_template.text, args = {}}
		end
	end
	
	return nil
end

return export