mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
refactor(settings): reset saved locales
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user