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:
Linden
2022-04-30 05:04:15 +10:00
parent 031cccd886
commit 48728f0241
4 changed files with 14 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ end
local function loadLocale(locale)
local resourceName = GetCurrentResourceName()
local JSON = LoadResourceFile(resourceName, ('locales/%s.json'):format(locale)) or LoadResourceFile(resourceName, ('locales/en-US.json'):format(locale))
local JSON = LoadResourceFile(resourceName, ('locales/%s.json'):format(locale)) or LoadResourceFile(resourceName, ('locales/en.json'):format(locale))
if JSON then
dict = json.decode(JSON)
@@ -26,6 +26,6 @@ end
AddEventHandler('ox_lib:setLocale', loadLocale)
return function()
local lang = IsDuplicityVersion() and lib.getServerLocale() or GetExternalKvpString('ox_lib', 'locale') or 'en-US'
local lang = IsDuplicityVersion() and lib.getServerLocale() or GetExternalKvpString('ox_lib', 'locale') or 'en'
loadLocale(lang)
end