Remove ESX dependency

This commit is contained in:
Jérémie N'gadi
2017-09-09 17:18:08 +02:00
parent 0591280999
commit 6e12cc8528
2 changed files with 22 additions and 1 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
description 'SkinChanger'
client_scripts {
'@es_extended/locale.lua',
'locale.lua',
'locales/de.lua',
'locales/en.lua',
'locales/fr.lua',
+21
View File
@@ -0,0 +1,21 @@
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 exists'
end
else
return 'Locale [' .. Config.Locale .. '] does not exists'
end
end
function _U(str, ...) -- Translate string first char uppercase
return tostring(_(str, ...):gsub("^%l", string.upper))
end