Difference between revisions 21306677 and 21306678 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)function show_editlink(current)
	return
		"<div class=\"noprint plainlinks\" style=\"float: right; clear: both; margin: 0 0 .5em 1em; background: #f9f9f9; border: 1px #aaaaaa solid; padding: 5px; font-weight: bold;\">[" ..
		mw.getCurrentFrame():callParserFunction{name = "fullurl", args = {current:getDataModule(), action = "edit"}} ..
		" Edit category data]</div>"
end

function show_pagelist(
infocurrent)
	local namespace = ""
	
	if current._info.label == "citations" or current._info.label == "citations of undefined terms" then
		namespace = "Citations"
	elseif current._info.code then
		local lang = require("Module:languages").getByCode(current._info.code)
		
		if lang then
			if lang:getType() == "reconstructed" then
				namespace = "Reconstruction"
			elseif lang:getType() == "appendix-constructed" then
				namespace = "Appendix"
			end
(contracted; show full)			return mw.getCurrentFrame():expandTemplate{title = TOC_template.text, args = {}}
		end
	end
	
	return nil
end

return export