Thanks for the correction. I will update the code.
I don't have a good explanation in english, just a code for how Lua metatable __index works and useful.
I don't have a good explanation in english, just a code for how Lua metatable __index works and useful.
Code:
local en = { ok = 'OK', cancel = 'Cancel' }local es = { ok = 'Aceptar' }-- Output: nilprint(es['cancel'])setmetatable(es, { __index = en })-- Output: Cancelprint(es['cancel'])
Statistics: Posted by nek — Today, 10:20 am — Replies 3 — Views 65