mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 23:16:03 +01:00
feat(locales): include some locales
Partial, and google translated just for the sake of setting an example. Also renamed many of the language codes where the extra characters are redundant (i.e. fr-FR, de-DE).
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
local userLocale = GetResourceKvpString('locale')
|
||||
|
||||
local function loadLocale(locale, cb)
|
||||
local JSON = LoadResourceFile('ox_lib', ('locales/%s.json'):format(locale)) or LoadResourceFile('ox_lib', ('locales/en-US.json'):format(locale))
|
||||
local JSON = LoadResourceFile('ox_lib', ('locales/%s.json'):format(locale)) or LoadResourceFile('ox_lib', ('locales/en.json'):format(locale))
|
||||
if cb then cb(JSON) end
|
||||
|
||||
SetResourceKvp('locale', locale)
|
||||
@@ -11,7 +11,7 @@ end
|
||||
RegisterNUICallback('getLocale', loadLocale)
|
||||
|
||||
if not userLocale then
|
||||
local default = { 'en-US', 'fr-FR', 'de-DE', 'it-IT', 'es-ES', 'pt-BR', 'pl-PL', 'ru-RU', 'ko-KR', 'zh-TW', 'ja-JP', 'es-MX', 'zh-CN' }
|
||||
local default = { 'en', 'fr', 'de', 'it', 'es', 'pt-BR', 'pl', 'ru', 'ko', 'zh-TW', 'ja', 'es-MX', 'zh-CN' }
|
||||
userLocale = default[GetCurrentLanguage() + 1]
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user