From 2ebaa422ea9718f0b757973bc13aa7a4ea43fe69 Mon Sep 17 00:00:00 2001 From: Kasey FItton Date: Tue, 15 Oct 2024 14:52:37 +0100 Subject: [PATCH 1/4] tweak: use txAdmin locale by default by default, use the txAdmin locale, unless a `esx:locale` is specified. This allows people to change languages easier, since everything will be in the same place, and if they want to specify a different language for ESX, then they can do. This also wont break anything, since it wont affect existing users whom will aready have the `esx:locale` set --- [core]/es_extended/config.lua | 6 +++++- server.cfg | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[core]/es_extended/config.lua b/[core]/es_extended/config.lua index 3d82a1f0..a451a42d 100644 --- a/[core]/es_extended/config.lua +++ b/[core]/es_extended/config.lua @@ -1,5 +1,9 @@ Config = {} -Config.Locale = GetConvar("esx:locale", "en") + +local txAdminLocale = GetConvar("txAdmin-locale", "en") +local esxLocale = GetConvar("esx:locale", "none") + +Config.Locale = esxLocale == "none" and txAdminLocale or esxLocale Config.OxInventory = GetResourceState("ox_inventory") ~= 'missing' diff --git a/server.cfg b/server.cfg index a4741dd0..5eb2a389 100644 --- a/server.cfg +++ b/server.cfg @@ -29,7 +29,9 @@ set onesync on # Enable OneSync [REQUIRED FOR LEGACY 1.7.5 +] set mysql_connection_string "mysql://user:password@localhost/es_extended?waitForConnections=true&charset=utf8mb4" set mysql_ui true -setr esx:locale "en" +## Umcomment to set your own locale, +## if not, it will use the language you have selected in txAdmin. +#setr esx:locale "en" ## These resources will start by default. ensure chat From 136c62bf776b69cfbaa2152f066336d4368bfafd Mon Sep 17 00:00:00 2001 From: Kasey FItton Date: Tue, 15 Oct 2024 15:39:36 +0100 Subject: [PATCH 2/4] twek(es_extended/config): account for txadminLocale being custom --- [core]/es_extended/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/config.lua b/[core]/es_extended/config.lua index a451a42d..ffabbecb 100644 --- a/[core]/es_extended/config.lua +++ b/[core]/es_extended/config.lua @@ -3,7 +3,7 @@ Config = {} local txAdminLocale = GetConvar("txAdmin-locale", "en") local esxLocale = GetConvar("esx:locale", "none") -Config.Locale = esxLocale == "none" and txAdminLocale or esxLocale +Config.Locale = (esxLocale == "none" and txAdminLocale ~= "custom") and txAdminLocale or esxLocale Config.OxInventory = GetResourceState("ox_inventory") ~= 'missing' From d077156c885e4f6dbd2a592ef8f10b477f3642ce Mon Sep 17 00:00:00 2001 From: Kasey FItton Date: Tue, 15 Oct 2024 15:40:58 +0100 Subject: [PATCH 3/4] tweak(es_extended/config): default to english --- [core]/es_extended/config.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/[core]/es_extended/config.lua b/[core]/es_extended/config.lua index ffabbecb..a2a2e310 100644 --- a/[core]/es_extended/config.lua +++ b/[core]/es_extended/config.lua @@ -3,7 +3,11 @@ Config = {} local txAdminLocale = GetConvar("txAdmin-locale", "en") local esxLocale = GetConvar("esx:locale", "none") -Config.Locale = (esxLocale == "none" and txAdminLocale ~= "custom") and txAdminLocale or esxLocale +if esxLocale == "none" then + Config.Locale = txAdminLocale ~= "custom" and txAdminLocale or "en" +else + Config.Locale = esxLocale +end Config.OxInventory = GetResourceState("ox_inventory") ~= 'missing' From 480d152f7648f6c93128a5f0ce7cbab2d04b10de Mon Sep 17 00:00:00 2001 From: Kasey FItton Date: Fri, 18 Oct 2024 07:58:52 +0100 Subject: [PATCH 4/4] tweak(es_extended/config): condense Config.Locale --- [core]/es_extended/config.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/[core]/es_extended/config.lua b/[core]/es_extended/config.lua index a2a2e310..95db96af 100644 --- a/[core]/es_extended/config.lua +++ b/[core]/es_extended/config.lua @@ -1,13 +1,9 @@ Config = {} local txAdminLocale = GetConvar("txAdmin-locale", "en") -local esxLocale = GetConvar("esx:locale", "none") +local esxLocale = GetConvar("esx:locale", "invalid") -if esxLocale == "none" then - Config.Locale = txAdminLocale ~= "custom" and txAdminLocale or "en" -else - Config.Locale = esxLocale -end +Config.Locale = (esxLocale ~= "invalid") and esxLocale or (txAdminLocale ~= "custom" and txAdminLocale) or "en" Config.OxInventory = GetResourceState("ox_inventory") ~= 'missing'