From 73bd5539b02ef38b2c50292d78772efd9561b74c Mon Sep 17 00:00:00 2001 From: nearbyplayer Date: Sun, 3 Sep 2017 15:36:57 -0400 Subject: [PATCH] Update Multi-Language Support --- client/main.lua | 12 ++++++------ locales/en.lua | 6 ++++++ locales/fr.lua | 6 ++++++ server/main.lua | 10 +++++----- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/client/main.lua b/client/main.lua index 57dcf625..9cc699f5 100644 --- a/client/main.lua +++ b/client/main.lua @@ -850,7 +850,7 @@ function OpenGetStocksMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'stocks_menu', { - title = 'Police Stock', + title = _U('police_stock'), elements = elements }, function(data, menu) @@ -860,14 +860,14 @@ function OpenGetStocksMenu() ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { - title = 'Quantité' + title = _U('quantity') }, function(data2, menu2) local count = tonumber(data2.value) if count == nil then - ESX.ShowNotification('Quantité invalide') + ESX.ShowNotification(_U('quantity_invalid')) else menu2.close() menu.close() @@ -911,7 +911,7 @@ function OpenPutStocksMenu() ESX.UI.Menu.Open( 'default', GetCurrentResourceName(), 'stocks_menu', { - title = 'Inventaire', + title = _U('inventory'), elements = elements }, function(data, menu) @@ -921,14 +921,14 @@ function OpenPutStocksMenu() ESX.UI.Menu.Open( 'dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { - title = 'Quantité' + title = _U('quantity') }, function(data2, menu2) local count = tonumber(data2.value) if count == nil then - ESX.ShowNotification('Quantité invalide') + ESX.ShowNotification(_U('quantity_invalid')) else menu2.close() menu.close() diff --git a/locales/en.lua b/locales/en.lua index 4f0a9562..16e9347d 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -69,6 +69,12 @@ Locales['en'] = { ['invalid_amount'] = 'amount Invalid', ['amount_of_deposit'] = 'amount of Deposit', ['open_bossmenu'] = 'press ~INPUT_CONTEXT~ to open the menu', + ['quantity_invalid'] = 'invalid quantity', + ['have_withdraw'] = 'you have withdrawn x', + ['added'] = 'you added x', + ['quantity'] = 'quantity', + ['inventory'] = 'inventory', + ['police_stock'] = 'Police Stock', --Misc ['remove_object'] = 'press ~INPUT_CONTEXT~ to delete the object', ['map_blip'] = 'police Station', diff --git a/locales/fr.lua b/locales/fr.lua index 6756fbeb..34fcb76a 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -69,6 +69,12 @@ Locales['fr'] = { ['invalid_amount'] = 'montant invalide', ['amount_of_deposit'] = 'montant du dépôt', ['open_bossmenu'] = 'appuez sur ~INPUT_CONTEXT~ pour ouvrir le menu', + ['quantity_invalid'] = 'Quantité invalide', + ['have_withdrawn'] = 'Vous avez retiré x', + ['added'] = 'Vous avez ajouté x', + ['quantity'] = 'Quantité', + ['inventory'] = 'inventaire', + ['police_stock'] = 'Police Stock', --Misc ['remove_object'] = 'appuez sur ~INPUT_CONTEXT~ pour enlever l\'objet', ['map_blip'] = 'Commissariat', diff --git a/server/main.lua b/server/main.lua index 3fbb6288..e95c3dd8 100644 --- a/server/main.lua +++ b/server/main.lua @@ -6,7 +6,7 @@ if Config.MaxInService ~= -1 then TriggerEvent('esx_service:activateService', 'police', Config.MaxInService) end -TriggerEvent('esx_phone:registerNumber', 'police', _('alert_police'), true, true) +TriggerEvent('esx_phone:registerNumber', 'police', _U('alert_police'), true, true) RegisterServerEvent('esx_policejob:giveWeapon') AddEventHandler('esx_policejob:giveWeapon', function(weapon, ammo) @@ -77,10 +77,10 @@ AddEventHandler('esx_policejob:getStockItem', function(itemName, count) inventory.removeItem(itemName, count) xPlayer.addInventoryItem(itemName, count) else - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Quantité invalide') + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) end - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez retiré x' .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. count .. ' ' .. item.label) end) @@ -99,10 +99,10 @@ AddEventHandler('esx_policejob:putStockItems', function(itemName, count) xPlayer.removeInventoryItem(itemName, count) inventory.addItem(itemName, count) else - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Quantité invalide') + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('quantity_invalid')) end - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez ajouté x' .. count .. ' ' .. item.label) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('added') .. count .. ' ' .. item.label) end)