跳转到内容

模組:Data/namespaces

維基詞典,自由的多語言詞典
local data = {}

local gsub = string.gsub
local next = next
local ulower = require("Module:string utilities").lower

for _, namespace in next, mw.site.namespaces do
	local prefix = ulower((gsub(namespace.name, "_", " ")))
	data[prefix] = prefix
	for _, alias in next, namespace.aliases do
		data[ulower((gsub(alias, "_", " ")))] = prefix
	end
end

return data