Terraria Wiki
Advertisement

此模块的文档可以在模块:Language info/doc创建

-- We only invoke this module once per page, therefore we do not need to use mw.loadData(), require() is faster.
local info = require("Module:Language info/data")

return {
	interwiki_links = function(frame)
		local key = frame.args['en']
		local lang = frame.args['lang']
		
		local str = ''
		-- local str = '<div style="display:none">languageinfo: en: '..key..' lang: '..lang..'</div>' -- debug code
		for k,v in pairs(info) do
			if k ~= lang then
				if v[key] then
					str = str .. '[[' .. k .. ':'.. v[key] .. ']]'
				end
			end
		end
		
		return str
	end,
}
Advertisement