Module:Special page interlanguage links/sandbox

From Bonkipedia
< Module:Special page interlanguage links
Revision as of 18:20, 12 November 2022 by ManfredoDo (talk | contribs) (1 revision imported: Module Import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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