diff --git a/[esx]/es_extended/locale.lua b/[esx]/es_extended/locale.lua index 68de6651..04482bea 100644 --- a/[esx]/es_extended/locale.lua +++ b/[esx]/es_extended/locale.lua @@ -1,19 +1,15 @@ Locales = {} function _(str, ...) -- Translate string - - if Locales[Config.Locale] ~= nil then - - if Locales[Config.Locale][str] ~= nil then - return string.format(Locales[Config.Locale][str], ...) - else - return 'Translation [' .. Config.Locale .. '][' .. str .. '] does not exist' - end - - else + if not Locales[Config.Locale] then return 'Locale [' .. Config.Locale .. '] does not exist' end + if Locales[Config.Locale][str] then + return string.format(Locales[Config.Locale][str], ...) + end + + return 'Translation [' .. Config.Locale .. '][' .. str .. '] does not exist' end function _U(str, ...) -- Translate string first char uppercase