Merge pull request #829 from Gellipapa/fix-2

fix(ex_extended locales.lua) fix nil value if change locales
This commit is contained in:
Gellipapa
2023-01-09 22:51:56 +01:00
committed by GitHub
+1 -2
View File
@@ -1,11 +1,10 @@
Locales = {}
function Translate(str, ...) -- Translate string
if Locales[Config.Locale] then
if Locales[Config.Locale][str] then
return string.format(Locales[Config.Locale][str], ...)
elseif Config.Locale ~= 'en' and Locales['en'][str] then
elseif Config.Locale ~= 'en' and Locales['en'] and Locales['en'][str] then
return string.format(Locales['en'][str], ...)
else
return 'Translation [' .. Config.Locale .. '][' .. str .. '] does not exist'