Module:Languages/cache/sandbox

From The Languages of David J. Peterson
Jump to navigation Jump to search

Documentation for this module may be created at Module:Languages/cache/sandbox/documentation

local getByCode = require("Module:languages/sandbox").getByCode

local langs = {}

-- Auto-create language objects: langs.en -> language object for English.
setmetatable(langs, {
	__index = function(self, key)
		local lang = getByCode(key) or false
		self[key] = lang
		return lang
	end
})

return langs