Module:Special page interlanguage links/sandbox: Difference between revisions

From Bonkipedia
[[mw:]]>Tacsipacsi
(Create sandbox version of Module:Special page interlanguage links)
 
m (1 revision imported: Module Import)
 
(No difference)

Latest revision as of 18:20, 12 November 2022

Documentation for this module may be created at Module:Special page interlanguage links/sandbox/doc

local p = {}

function p._main(specialPageName)
	local links = {}
	for n, _ in pairs(mw.site.interwikiMap('local')) do
		if mw.language.isKnownLanguageTag(n) then
			table.insert(links, string.format('[[%s:Special:%s]]', n, specialPageName))
		end
	end
	table.sort(links)
	return table.concat(links)
end

function p.main(frame)
	return p._main(frame.args[1])
end

return p