local config = require('shared/config') function debugPrint(msg) if config.debugPrint then lib.print.info(msg) end end function locale(key, ...) local playerLang = config.Locale or 'en' local langTable = Locales[playerLang] or Locales['en'] local keys = {} for k in string.gmatch(key, "([^%.]+)") do table.insert(keys, k) end local value = langTable for _, k in ipairs(keys) do if value[k] then value = value[k] else value = nil break end end if not value or type(value) ~= 'string' then return key end if select('#', ...) > 0 then return string.format(value, ...) end return value end