add locale func

This commit is contained in:
Lorraxs 2024-01-12 17:45:08 +07:00
parent 808c3b5b91
commit 02a5f0d8af
2 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,6 @@
Config = {}
Config.UISetting = {
Config.Settings = {
locale = {}
}
@ -21,3 +21,11 @@ Config.Nui = false
Config.Dev = false
Config.Framework = "custom" -- "qb" | "esx" | "custom"
Config.ClientLazyLoad = false
function L(key, ...)
if Config.Settings.locale[key] then
return string.format(Config.Settings.locale[key], ...)
else
return key
end
end

View File

@ -20,7 +20,7 @@ if IsDuplicityVersion() then
end
else
RegisterNUICallback('AppReady', function(data, cb)
cb(Config.UISetting or {})
cb(Config.Settings or {})
NuiReady = true
end)
end