mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-15 17:33:56 +00:00
feat(settings): add ox_lib command and user-selected locales
Resolves #435.
This commit is contained in:
1 parent
1e3b2cb567
commit
2d4e56d828
29 files changed
+164
-28
No files matched your search
@@ -0,0 +1,24 @@
|
||||
local settings = {
|
||||
locale = GetResourceKvpString('locale'),
|
||||
}
|
||||
|
||||
if not settings.locale then lib.setLocale(GetConvar('ox:locale', 'en')) end
|
||||
|
||||
RegisterCommand('ox_lib', function()
|
||||
local input = lib.inputDialog('Settings', {
|
||||
{
|
||||
type = 'select',
|
||||
label = locale('ui.settings.locale'),
|
||||
searchable = true,
|
||||
description = locale('ui.settings.locale_description', settings.locale),
|
||||
options = GlobalState['ox_lib:locales'],
|
||||
icon = 'book',
|
||||
}
|
||||
}) --[[@as any]]
|
||||
|
||||
if not input then return end
|
||||
|
||||
if input[1] then lib.setLocale(input[1]) end
|
||||
end)
|
||||
|
||||
return settings
|
||||
Reference in new issue
Block a user