refactor(settings): reset saved locales

This commit is contained in:
Linden
2024-04-17 21:12:20 +10:00
parent 97365df94f
commit 3fc84398f6

View File

@@ -1,9 +1,17 @@
-- Some users have locale set from ox_lib v2
if GetResourceKvpInt('reset_locale') ~= 1 then
DeleteResourceKvp('locale')
SetResourceKvpInt('reset_locale', 1)
end
local settings = { local settings = {
locale = GetResourceKvpString('locale') or GetConvar('ox:locale', 'en'), default_locale = GetConvar('ox:locale', 'en'),
notification_position = GetResourceKvpString('notification_position') or 'top-right', notification_position = GetResourceKvpString('notification_position') or 'top-right',
notification_audio = GetResourceKvpInt('notification_audio') == 1 notification_audio = GetResourceKvpInt('notification_audio') == 1
} }
settings.locale = GetResourceKvpString('locale') or settings.default_locale
local function set(key, value) local function set(key, value)
if settings[key] == value then return false end if settings[key] == value then return false end