Merge pull request #1 from CaliforniaRP/master

Multi-language support
This commit is contained in:
Jérémie N'gadi
2017-08-16 09:31:15 +02:00
committed by GitHub
6 changed files with 39 additions and 17 deletions
+6
View File
@@ -3,10 +3,16 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
description 'ESX Skin'
server_scripts {
'@es_extended/locale.lua',
'locales/en.lua',
'locales/fr.lua',
'@mysql-async/lib/MySQL.lua',
'server/main.lua'
}
client_scripts {
'@es_extended/locale.lua',
'locales/en.lua',
'locales/fr.lua',
'client/main.lua'
}
+14 -14
View File
@@ -53,10 +53,10 @@ function OpenMenu(submitCb, cancelCb, restrict)
-- Insert elements
for i=1, #_components, 1 do
local value = _components[i].value
local componentId = _components[i].componentId
if componentId == 0 then
value = GetPedPropIndex(playerPed, _components[i].componentId)
end
@@ -89,7 +89,7 @@ function OpenMenu(submitCb, cancelCb, restrict)
ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'skin',
{
title = 'Skin Menu',
title = _U('skin_menu'),
align = 'top-left',
elements = elements
},
@@ -98,7 +98,7 @@ function OpenMenu(submitCb, cancelCb, restrict)
DeleteSkinCam()
end,
function(data, menu)
menu.close()
DeleteSkinCam()
@@ -116,7 +116,7 @@ function OpenMenu(submitCb, cancelCb, restrict)
zoomOffset = data.current.zoomOffset
camOffset = data.current.camOffset
if skin[data.current.name] ~= data.current.value then
-- Change skin element
@@ -124,10 +124,10 @@ function OpenMenu(submitCb, cancelCb, restrict)
-- Update max values
TriggerEvent('skinchanger:getData', function(components, maxVals)
for i=1, #elements, 1 do
if elements[i].textureof ~= nil then
local newData = {max = maxVals[elements[i].name]}
if data.current.name == elements[i].textureof then
@@ -135,7 +135,7 @@ function OpenMenu(submitCb, cancelCb, restrict)
end
menu.update({name = elements[i].name}, newData)
end
end
@@ -219,7 +219,7 @@ Citizen.CreateThread(function()
PointCamAtCoord(cam, posToLook.x, posToLook.y, coords.z + camOffset)
SetTextComponentFormat("STRING")
AddTextComponentString("Utilisez ~INPUT_VEH_FLY_ROLL_LEFT_ONLY~ et ~INPUT_VEH_FLY_ROLL_RIGHT_ONLY~ pour tourner la vue.")
AddTextComponentString(_U('use_rotate_view'))
DisplayHelpTextFromStringLabel(0, 0, 0, -1)
end
end
@@ -305,9 +305,9 @@ AddEventHandler('esx_skin:openSaveableRestrictedMenu', function(submitCb, cancel
end)
AddEventHandler('skinchanger:modelLoaded', function()
if not HasLoadedModel then
Citizen.CreateThread(function()
while not PlayerLoaded do
@@ -333,9 +333,9 @@ end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local playerPed = GetPlayerPed(-1)
if IsEntityDead(playerPed) then
@@ -343,4 +343,4 @@ Citizen.CreateThread(function()
end
end
end)
end)
+2
View File
@@ -0,0 +1,2 @@
Config = {}
Config.Locale = 'fr'
+7
View File
@@ -0,0 +1,7 @@
Locales['en'] = {
['skin_menu'] = 'Skin Menu',
['use_rotate_view'] = 'use ~INPUT_VEH_FLY_ROLL_LEFT_ONLY~ and ~INPUT_VEH_FLY_ROLL_RIGHT_ONLY~ to rotate the view.',
}
+7
View File
@@ -0,0 +1,7 @@
Locales['fr'] = {
['skin_menu'] = 'Skin Menu',
['use_rotate_view'] = 'utilisez ~INPUT_VEH_FLY_ROLL_LEFT_ONLY~ et ~INPUT_VEH_FLY_ROLL_RIGHT_ONLY~ pour tourner la vue.',
}
+3 -3
View File
@@ -30,7 +30,7 @@ ESX.RegisterServerCallback('esx_skin:getPlayerSkin', function(source, cb)
local user = users[1]
local skin = nil
local jobSkin = {
skin_male = xPlayer.job.skin_male,
skin_female = xPlayer.job.skin_female
@@ -51,5 +51,5 @@ end)
TriggerEvent('es:addGroupCommand', 'skin', "admin", function(source, args, user)
TriggerClientEvent('esx_skin:openSaveableMenu', source)
end, function(source, args, user)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, 'Insufficienct permissions!')
end)
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, 'Insufficient permissions!')
end)