Module:Tr/loaddata

local cache = mw.ext.LuaCache

return { load = function(lang) local status, result = pcall(function 		return mw.text.jsonDecode(cache.get('tr__database-'..lang))	end) if status then return result else -- fallback local info = require('Module:Tr/db-'..lang) -- return table of mw.loadData has metatable, can not be used for mw.loadData. cache.set( 'tr__database-'..lang, mw.text.jsonEncode(info)) return info end end, purge = function(lang) mw.ext.LuaCache.delete( 'tr__database-'..lang) end }