diff --git a/modules/init.lua b/modules/init.lua index df7f79c0bf..b9ef18aaee 100644 --- a/modules/init.lua +++ b/modules/init.lua @@ -4,19 +4,12 @@ function ox.warning(...) ox.print('^3[warning]^7', ...) end function ox.error(...) error('\n^1[error] '.. ... ..'^7', 2) end function data(name) - if ox.ready == nil then return {} end + if ox.server and ox.ready == nil then return {} end local func, err = load(LoadResourceFile(ox.resource, ('data/%s.lua'):format(name))) if err then error('^1'..err..'^0', 0) end return func() end -local Locales = data('locales/'..ox.locale) -function ox.locale(string, ...) - if not string then return Locales end - if Locales[string] then return Locales[string]:format(...) end - return string -end - do if not SetInterval or not import then ox.error('Ox Inventory requires the pe-lualib resource, refer to the documentation.') @@ -43,4 +36,11 @@ if ox.qtarget and GetResourceState('qtarget') ~= 'started' then ox.info('qtarget is not running; disabled compatibility mode') end -ox.ready = false +if ox.server then ox.ready = false end + +local Locales = data('locales/'..ox.locale) +function ox.locale(string, ...) + if not string then return Locales end + if Locales[string] then return Locales[string]:format(...) end + return string +end diff --git a/web/src/components/App.tsx b/web/src/components/App.tsx index f69dd4bdc8..92cbdefa00 100644 --- a/web/src/components/App.tsx +++ b/web/src/components/App.tsx @@ -56,7 +56,7 @@ const App: React.FC = () => { fetchNui('uiLoaded', {}); useNuiEvent<{ - sentry: boolean; + // sentry: boolean; locale: { [key: string]: string }; items: typeof Items; leftInventory: Inventory;