From 2a3f34af0bd47e97aa004230506dcca927760af7 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 26 Aug 2022 16:33:07 +0100 Subject: [PATCH] feat: esx_property - basic translations --- [esx_addons]/esx_property/client/cctv.lua | 18 +++++++++--------- [esx_addons]/esx_property/config.lua | 2 +- [esx_addons]/esx_property/fxmanifest.lua | 6 +----- [esx_addons]/esx_property/locales/en.lua | 12 ++++++++++++ 4 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 [esx_addons]/esx_property/locales/en.lua diff --git a/[esx_addons]/esx_property/client/cctv.lua b/[esx_addons]/esx_property/client/cctv.lua index 5585c71e..9fe7135a 100644 --- a/[esx_addons]/esx_property/client/cctv.lua +++ b/[esx_addons]/esx_property/client/cctv.lua @@ -48,7 +48,7 @@ function CCTV(PropertyID) PushScaleformMovieFunction(scaleform, "SET_DATA_SLOT") PushScaleformMovieFunctionParameterInt(1) N_0xe83a3e3557a56640(GetControlInstructionalButton(1, Config.CCTV.Controls.Screenshot, true)) - InstructionButtonMessage("Take Picture") + InstructionButtonMessage(_U("take_picture")) PopScaleformMovieFunctionVoid() end @@ -56,33 +56,33 @@ function CCTV(PropertyID) PushScaleformMovieFunctionParameterInt(2) N_0xe83a3e3557a56640(GetControlInstructionalButton(1, Config.CCTV.Controls.Right, true)) N_0xe83a3e3557a56640(GetControlInstructionalButton(1, Config.CCTV.Controls.Left, true)) - InstructionButtonMessage("Left/Right") + InstructionButtonMessage(_U("rot_left_right")) PopScaleformMovieFunctionVoid() PushScaleformMovieFunction(scaleform, "SET_DATA_SLOT") PushScaleformMovieFunctionParameterInt(3) N_0xe83a3e3557a56640(GetControlInstructionalButton(1, Config.CCTV.Controls.Down, true)) N_0xe83a3e3557a56640(GetControlInstructionalButton(1, Config.CCTV.Controls.Up, true)) - InstructionButtonMessage("Up/Down") + InstructionButtonMessage(_U("rot_up_down")) PopScaleformMovieFunctionVoid() PushScaleformMovieFunction(scaleform, "SET_DATA_SLOT") PushScaleformMovieFunctionParameterInt(4) N_0xe83a3e3557a56640(GetControlInstructionalButton(1, Config.CCTV.Controls.ZoomOut, true)) N_0xe83a3e3557a56640(GetControlInstructionalButton(1, Config.CCTV.Controls.ZoomIn, true)) - InstructionButtonMessage("Zoom In/Out") + InstructionButtonMessage(_U("Zoom")) PopScaleformMovieFunctionVoid() PushScaleformMovieFunction(scaleform, "SET_DATA_SLOT") PushScaleformMovieFunctionParameterInt(5) N_0xe83a3e3557a56640(GetControlInstructionalButton(1, Config.CCTV.Controls.NightVision, true)) - InstructionButtonMessage("Toggle Night Vision") + InstructionButtonMessage(_U("night_vision")) PopScaleformMovieFunctionVoid() PushScaleformMovieFunction(scaleform, "SET_DATA_SLOT") PushScaleformMovieFunctionParameterInt(0) N_0xe83a3e3557a56640(GetControlInstructionalButton(1, Config.CCTV.Controls.Exit, true)) - InstructionButtonMessage("Exit Camera") + InstructionButtonMessage(_U("exit")) PopScaleformMovieFunctionVoid() PushScaleformMovieFunction(scaleform, "DRAW_INSTRUCTIONAL_BUTTONS") @@ -199,7 +199,7 @@ function CCTV(PropertyID) SetTextDropshadow(0.1, 3, 27, 27, 255) BeginTextCommandDisplayText('STRING') local Zoom = ((Config.CCTV.FOV - GetCamFov(cctvcam)) / GetCamFov(cctvcam)) * 100 - AddTextComponentSubstringPlayerName("Zoom Level: " .. math.floor(Zoom) .. "%") + AddTextComponentSubstringPlayerName(_U("zoom_level", math.floor(Zoom))) EndTextCommandDisplayText(0.01, 0.09) SetTextFont(4) @@ -233,7 +233,7 @@ function CCTV(PropertyID) print(ESX.DumpTable(image)) ESX.ShowNotification("Picture Taken!", "success") SendNUIMessage({link = image.attachments[1].proxy_url}) - ESX.ShowNotification("Link Copied To ~b~Cipboard", "success") + ESX.ShowNotification(_U("clipboard"), "success") ShowButtons = true CamTakePic = false SetTimeout(5000, function() @@ -243,7 +243,7 @@ function CCTV(PropertyID) end end) else - ESX.ShowNotification("Please Wait Before taking another ~b~Picture", "error") + ESX.ShowNotification(_U("please_wait"), "error") end end diff --git a/[esx_addons]/esx_property/config.lua b/[esx_addons]/esx_property/config.lua index 9766af75..13fd373c 100644 --- a/[esx_addons]/esx_property/config.lua +++ b/[esx_addons]/esx_property/config.lua @@ -76,7 +76,7 @@ Config.Furniture = { --------------------- CCTV Settings --------------------------------- Config.CCTV = { Enabled = true, - PictureWebook = IsDuplicityVersion() and "Change This String" or "DO NOT CHANGE THIS STRING", -- Set a discord webhook here to enable taking pictures of the CCTV (link is copied to user`s clipboard) + PictureWebook = IsDuplicityVersion() and "" or "DO NOT CHANGE THIS STRING", -- Set a discord webhook here to enable taking pictures of the CCTV (link is copied to user`s clipboard) HeightAboveDoor = 2.5, -- Height above the door to place the cctv camera FOV = 80.0, -- Camera Field of View MaxLeftRotation = 80, diff --git a/[esx_addons]/esx_property/fxmanifest.lua b/[esx_addons]/esx_property/fxmanifest.lua index 285cf170..f8b1b1b3 100644 --- a/[esx_addons]/esx_property/fxmanifest.lua +++ b/[esx_addons]/esx_property/fxmanifest.lua @@ -25,21 +25,17 @@ description 'Official ESX-Legacy Property System' version '1.8.0' -shared_script '@es_extended/imports.lua' +shared_scripts {'@es_extended/imports.lua', '@es_extended/locale.lua', 'locales/*.lua'} file "client/html/copy.html" ui_page "client/html/copy.html" server_scripts { '@oxmysql/lib/MySQL.lua', - '@es_extended/locale.lua', - 'locales/*.lua', 'config.lua', 'server/*.lua' } client_scripts { - '@es_extended/locale.lua', - 'locales/*.lua', 'config.lua', 'client/cctv.lua', 'client/main.lua', diff --git a/[esx_addons]/esx_property/locales/en.lua b/[esx_addons]/esx_property/locales/en.lua new file mode 100644 index 00000000..383fee1a --- /dev/null +++ b/[esx_addons]/esx_property/locales/en.lua @@ -0,0 +1,12 @@ +Locales['en'] = { + --- CCTV Strings ------ + ["take_picture"] = "Take Picture", + ["rot_left_right"] = "Left/Right", + ["rot_up_down"] = "Up/Down", + ["Zoom"] = "Zoom In/Out", + ["Zoom_level"] = "Zoom Level: %s %", + ["night_vision"] = "Toggle Night Vision", + ["clipboard"] = "Link Copied To ~b~Cipboard", + ["please_wait"] = "Please Wait Before taking another ~b~Picture", + ["exit"] = "Exit" +} \ No newline at end of file