Base for translating es_extended

This commit is contained in:
Jérémie N'gadi
2017-08-12 12:29:07 +02:00
parent bf637611d0
commit 9244d37265
7 changed files with 121 additions and 89 deletions
@@ -6,6 +6,10 @@ server_scripts {
'@async/async.lua',
'@mysql-async/lib/MySQL.lua',
'config.lua',
'locale.lua',
'locales/fr.lua',
'locales/en.lua',
'config.weapons.lua',
'server/common.lua',
'server/classes/player.lua',
'server/functions.lua',
@@ -15,6 +19,10 @@ server_scripts {
client_scripts {
'config.lua',
'locale.lua',
'locales/fr.lua',
'locales/en.lua',
'config.weapons.lua',
'client/common.lua',
'client/functions.lua',
'client/main.lua'
@@ -874,7 +874,7 @@ ESX.ShowInventory = function()
ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'inventory',
{
title = 'Inventaire',
title = _U('inventory'),
align = 'bottom-right',
elements = elements,
},
@@ -885,17 +885,17 @@ ESX.ShowInventory = function()
local elements = {}
if data.current.usable then
table.insert(elements, {label = 'Utiliser', action = 'use', type = data.current.type, value = data.current.value})
table.insert(elements, {label = _U('use'), action = 'use', type = data.current.type, value = data.current.value})
end
table.insert(elements, {label = 'Donner', action = 'give', type = data.current.type, value = data.current.value})
table.insert(elements, {label = 'Jeter', action = 'remove', type = data.current.type, value = data.current.value})
table.insert(elements, {label = 'Retour', action = 'return'})
table.insert(elements, {label = _U('give'), action = 'give', type = data.current.type, value = data.current.value})
table.insert(elements, {label = _U('remove'), action = 'remove', type = data.current.type, value = data.current.value})
table.insert(elements, {label = _U('return'), action = 'return'})
ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'inventory_item',
{
title = 'Inventaire',
title = _U('inventory'),
align = 'bottom-right',
elements = elements,
},
+1 -83
View File
@@ -6,86 +6,4 @@ Config.PaycheckInterval = 7 * 60000
Config.ShowDotAbovePlayer = false
Config.DisableWantedLevel = true
Config.RemoveInventoryItemDelay = 5 * 60000
Config.Locale = 'fr_FR'
Config.Weapons = {
{name = 'WEAPON_KNIFE', label = 'Couteau'},
{name = 'WEAPON_NIGHTSTICK', label = 'Matraque'},
{name = 'WEAPON_HAMMER', label = 'Marteau'},
{name = 'WEAPON_BAT', label = 'Bat'},
{name = 'WEAPON_GOLFCLUB', label = 'Club de golfe'},
{name = 'WEAPON_CROWBAR', label = 'Pied de biche'},
{name = 'WEAPON_PISTOL', label = 'Pistolet'},
{name = 'WEAPON_COMBATPISTOL', label = 'Pistolet de combat'},
{name = 'WEAPON_APPISTOL', label = 'Pistolet automatique'},
{name = 'WEAPON_PISTOL50', label = 'Pistolet calibre 50'},
{name = 'WEAPON_MICROSMG', label = 'Micro SMG'},
{name = 'WEAPON_SMG', label = 'SMG'},
{name = 'WEAPON_ASSAULTSMG', label = 'SMG d\'assaut'},
{name = 'WEAPON_ASSAULTRIFLE', label = 'Fusil d\'assaut'},
{name = 'WEAPON_CARBINERIFLE', label = 'Carabine d\'assaut'},
{name = 'WEAPON_ADVANCEDRIFLE', label = 'Fusil avancé'},
{name = 'WEAPON_MG', label = 'Mitrailleuse'},
{name = 'WEAPON_COMBATMG', label = 'Mitrailleuse de combat'},
{name = 'WEAPON_PUMPSHOTGUN', label = 'Fusil à pompe'},
{name = 'WEAPON_SAWNOFFSHOTGUN', label = 'Carabine à canon scié'},
{name = 'WEAPON_ASSAULTSHOTGUN', label = 'Carabine d\'assaut'},
{name = 'WEAPON_BULLPUPSHOTGUN', label = 'Carabine Bullpup'},
{name = 'WEAPON_STUNGUN', label = 'Tazer'},
{name = 'WEAPON_SNIPERRIFLE', label = 'Fusil de sniper'},
{name = 'WEAPON_HEAVYSNIPER', label = 'Fusil de sniper lourd'},
{name = 'WEAPON_REMOTESNIPER', label = 'Fusil de sniper à distance'},
{name = 'WEAPON_GRENADELAUNCHER', label = 'Lance-grenade'},
{name = 'WEAPON_RPG', label = 'Lance-rocket'},
{name = 'WEAPON_STINGER', label = 'Lance-Missile Stinger'},
{name = 'WEAPON_MINIGUN', label = 'Minigun'},
{name = 'WEAPON_GRENADE', label = 'Grenade'},
{name = 'WEAPON_STICKYBOMB', label = 'Bombe collante'},
{name = 'WEAPON_SMOKEGRENADE', label = 'Grenade fumigène'},
{name = 'WEAPON_BZGAS', label = 'Grenade à gaz BZ'},
{name = 'WEAPON_MOLOTOV', label = 'Cocktail molotov'},
{name = 'WEAPON_FIREEXTINGUISHER', label = 'Extincteur'},
{name = 'WEAPON_PETROLCAN', label = 'Jerrican d\'essence'},
{name = 'WEAPON_DIGISCANNER', label = 'Digiscanner'},
{name = 'WEAPON_BALL', label = 'Balle'},
{name = 'WEAPON_SNSPISTOL', label = 'Pistolet SNS'},
{name = 'WEAPON_BOTTLE', label = 'Bouteille'},
{name = 'WEAPON_GUSENBERG', label = 'Balayeuse Gusenberg'},
{name = 'WEAPON_SPECIALCARBINE', label = 'Carabine spéciale'},
{name = 'WEAPON_HEAVYPISTOL', label = 'Pistolet lourd'},
{name = 'WEAPON_BULLPUPRIFLE', label = 'Fusil Bullpup'},
{name = 'WEAPON_DAGGER', label = 'Poignard'},
{name = 'WEAPON_VINTAGEPISTOL', label = 'Pistolet vintage'},
{name = 'WEAPON_FIREWORK', label = 'Feu d\'artifice'},
{name = 'WEAPON_MUSKET', label = 'Mousquet'},
{name = 'WEAPON_HEAVYSHOTGUN', label = 'Fusil à pompe lourd'},
{name = 'WEAPON_MARKSMANRIFLE', label = 'Fusil Marksman'},
{name = 'WEAPON_HOMINGLAUNCHER', label = 'Lance tête-chercheuse'},
{name = 'WEAPON_PROXMINE', label = 'Mine de proximité'},
{name = 'WEAPON_SNOWBALL', label = 'Boule de neige'},
{name = 'WEAPON_FLAREGUN', label = 'Lance fusée de détresse'},
{name = 'WEAPON_GARBAGEBAG', label = 'Sac poubelle'},
{name = 'WEAPON_HANDCUFFS', label = 'Menottes'},
{name = 'WEAPON_COMBATPDW', label = 'Arme de défense personnelle'},
{name = 'WEAPON_MARKSMANPISTOL', label = 'Pistolet Marksman'},
{name = 'WEAPON_KNUCKLE', label = 'Poing américain'},
{name = 'WEAPON_HATCHET', label = 'Hachette'},
{name = 'WEAPON_RAILGUN', label = 'Canon éléctrique'},
{name = 'WEAPON_MACHETE', label = 'Machetta'},
{name = 'WEAPON_MACHINEPISTOL', label = 'Pistolet mitrailleur'},
{name = 'WEAPON_SWITCHBLADE', label = 'Couteau à cran d\'arrêt'},
{name = 'WEAPON_REVOLVER', label = 'Revolver'},
{name = 'WEAPON_DBSHOTGUN', label = 'Fusil à pompe double canon'},
{name = 'WEAPON_COMPACTRIFLE', label = 'Fusil compact'},
{name = 'WEAPON_AUTOSHOTGUN', label = 'Fusil à pompe automatique'},
{name = 'WEAPON_BATTLEAXE', label = 'Hache de combat'},
{name = 'WEAPON_COMPACTLAUNCHER', label = 'Lanceur compact'},
{name = 'WEAPON_MINISMG', label = 'Mini SMG'},
{name = 'WEAPON_PIPEBOMB', label = 'Bombe tuyau'},
{name = 'WEAPON_POOLCUE', label = 'Queue de billard'},
{name = 'WEAPON_WRENCH', label = 'Clé'},
{name = 'WEAPON_FLASHLIGHT', label = 'Lampe torche'},
{name = 'GADGET_NIGHTVISION', label = 'Vision nocturne'},
{name = 'GADGET_PARACHUTE', label = 'Parachute'},
}
Config.Locale = 'fr'
@@ -0,0 +1,81 @@
Config.Weapons = {
{name = 'WEAPON_KNIFE', label = _U('weapon_knife')},
{name = 'WEAPON_NIGHTSTICK', label = 'Matraque'},
{name = 'WEAPON_HAMMER', label = 'Marteau'},
{name = 'WEAPON_BAT', label = 'Bat'},
{name = 'WEAPON_GOLFCLUB', label = 'Club de golfe'},
{name = 'WEAPON_CROWBAR', label = 'Pied de biche'},
{name = 'WEAPON_PISTOL', label = 'Pistolet'},
{name = 'WEAPON_COMBATPISTOL', label = 'Pistolet de combat'},
{name = 'WEAPON_APPISTOL', label = 'Pistolet automatique'},
{name = 'WEAPON_PISTOL50', label = 'Pistolet calibre 50'},
{name = 'WEAPON_MICROSMG', label = 'Micro SMG'},
{name = 'WEAPON_SMG', label = 'SMG'},
{name = 'WEAPON_ASSAULTSMG', label = 'SMG d\'assaut'},
{name = 'WEAPON_ASSAULTRIFLE', label = 'Fusil d\'assaut'},
{name = 'WEAPON_CARBINERIFLE', label = 'Carabine d\'assaut'},
{name = 'WEAPON_ADVANCEDRIFLE', label = 'Fusil avancé'},
{name = 'WEAPON_MG', label = 'Mitrailleuse'},
{name = 'WEAPON_COMBATMG', label = 'Mitrailleuse de combat'},
{name = 'WEAPON_PUMPSHOTGUN', label = 'Fusil à pompe'},
{name = 'WEAPON_SAWNOFFSHOTGUN', label = 'Carabine à canon scié'},
{name = 'WEAPON_ASSAULTSHOTGUN', label = 'Carabine d\'assaut'},
{name = 'WEAPON_BULLPUPSHOTGUN', label = 'Carabine Bullpup'},
{name = 'WEAPON_STUNGUN', label = 'Tazer'},
{name = 'WEAPON_SNIPERRIFLE', label = 'Fusil de sniper'},
{name = 'WEAPON_HEAVYSNIPER', label = 'Fusil de sniper lourd'},
{name = 'WEAPON_REMOTESNIPER', label = 'Fusil de sniper à distance'},
{name = 'WEAPON_GRENADELAUNCHER', label = 'Lance-grenade'},
{name = 'WEAPON_RPG', label = 'Lance-rocket'},
{name = 'WEAPON_STINGER', label = 'Lance-Missile Stinger'},
{name = 'WEAPON_MINIGUN', label = 'Minigun'},
{name = 'WEAPON_GRENADE', label = 'Grenade'},
{name = 'WEAPON_STICKYBOMB', label = 'Bombe collante'},
{name = 'WEAPON_SMOKEGRENADE', label = 'Grenade fumigène'},
{name = 'WEAPON_BZGAS', label = 'Grenade à gaz BZ'},
{name = 'WEAPON_MOLOTOV', label = 'Cocktail molotov'},
{name = 'WEAPON_FIREEXTINGUISHER', label = 'Extincteur'},
{name = 'WEAPON_PETROLCAN', label = 'Jerrican d\'essence'},
{name = 'WEAPON_DIGISCANNER', label = 'Digiscanner'},
{name = 'WEAPON_BALL', label = 'Balle'},
{name = 'WEAPON_SNSPISTOL', label = 'Pistolet SNS'},
{name = 'WEAPON_BOTTLE', label = 'Bouteille'},
{name = 'WEAPON_GUSENBERG', label = 'Balayeuse Gusenberg'},
{name = 'WEAPON_SPECIALCARBINE', label = 'Carabine spéciale'},
{name = 'WEAPON_HEAVYPISTOL', label = 'Pistolet lourd'},
{name = 'WEAPON_BULLPUPRIFLE', label = 'Fusil Bullpup'},
{name = 'WEAPON_DAGGER', label = 'Poignard'},
{name = 'WEAPON_VINTAGEPISTOL', label = 'Pistolet vintage'},
{name = 'WEAPON_FIREWORK', label = 'Feu d\'artifice'},
{name = 'WEAPON_MUSKET', label = 'Mousquet'},
{name = 'WEAPON_HEAVYSHOTGUN', label = 'Fusil à pompe lourd'},
{name = 'WEAPON_MARKSMANRIFLE', label = 'Fusil Marksman'},
{name = 'WEAPON_HOMINGLAUNCHER', label = 'Lance tête-chercheuse'},
{name = 'WEAPON_PROXMINE', label = 'Mine de proximité'},
{name = 'WEAPON_SNOWBALL', label = 'Boule de neige'},
{name = 'WEAPON_FLAREGUN', label = 'Lance fusée de détresse'},
{name = 'WEAPON_GARBAGEBAG', label = 'Sac poubelle'},
{name = 'WEAPON_HANDCUFFS', label = 'Menottes'},
{name = 'WEAPON_COMBATPDW', label = 'Arme de défense personnelle'},
{name = 'WEAPON_MARKSMANPISTOL', label = 'Pistolet Marksman'},
{name = 'WEAPON_KNUCKLE', label = 'Poing américain'},
{name = 'WEAPON_HATCHET', label = 'Hachette'},
{name = 'WEAPON_RAILGUN', label = 'Canon éléctrique'},
{name = 'WEAPON_MACHETE', label = 'Machetta'},
{name = 'WEAPON_MACHINEPISTOL', label = 'Pistolet mitrailleur'},
{name = 'WEAPON_SWITCHBLADE', label = 'Couteau à cran d\'arrêt'},
{name = 'WEAPON_REVOLVER', label = 'Revolver'},
{name = 'WEAPON_DBSHOTGUN', label = 'Fusil à pompe double canon'},
{name = 'WEAPON_COMPACTRIFLE', label = 'Fusil compact'},
{name = 'WEAPON_AUTOSHOTGUN', label = 'Fusil à pompe automatique'},
{name = 'WEAPON_BATTLEAXE', label = 'Hache de combat'},
{name = 'WEAPON_COMPACTLAUNCHER', label = 'Lanceur compact'},
{name = 'WEAPON_MINISMG', label = 'Mini SMG'},
{name = 'WEAPON_PIPEBOMB', label = 'Bombe tuyau'},
{name = 'WEAPON_POOLCUE', label = 'Queue de billard'},
{name = 'WEAPON_WRENCH', label = 'Clé'},
{name = 'WEAPON_FLASHLIGHT', label = 'Lampe torche'},
{name = 'GADGET_NIGHTVISION', label = 'Vision nocturne'},
{name = 'GADGET_PARACHUTE', label = 'Parachute'},
}
@@ -0,0 +1,9 @@
Locales = {}
function _(str, ...) -- Translate string
return string.format(Locales[Config.Locale][str], ...)
end
function _U(str, ...) -- Translate string first char uppercase
return _(str, ...):gsub("^%l", string.upper)
end
@@ -0,0 +1,8 @@
Locales.en = {
['inventory'] = 'inventory',
['use'] = 'use',
['give'] = 'give',
['remove'] = 'remove',
['return'] = 'return',
['weapon_knife'] = 'knife',
}
@@ -0,0 +1,8 @@
Locales['fr'] = {
['inventory'] = 'inventaire',
['use'] = 'utiliser',
['give'] = 'donner',
['remove'] = 'jeter',
['return'] = 'retour',
['weapon_knife'] = 'couteau',
}