From 3f079ddb28160277eb89554e76cea51562298c34 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 26 Aug 2022 17:32:33 +0100 Subject: [PATCH] feat: esx_property - Real Estate Translations --- [esx_addons]/esx_property/client/main.lua | 18 +++++++++--------- [esx_addons]/esx_property/locales/en.lua | 15 ++++++++++++++- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/[esx_addons]/esx_property/client/main.lua b/[esx_addons]/esx_property/client/main.lua index 5923fe90..176857ec 100644 --- a/[esx_addons]/esx_property/client/main.lua +++ b/[esx_addons]/esx_property/client/main.lua @@ -841,9 +841,9 @@ function OpenPMQuickMenu(Action) Wait(1500) ESX.TriggerServerCallback("esx_property:PMenterOffice", function(HasEntered) if HasEntered then - ESX.ShowNotification("~b~Entering~s~ Office.", "success") + ESX.ShowNotification(_U("enter_office"), "success") else - ESX.ShowNotification("You ~r~Cannot~s~ Enter This Office!", "error") + ESX.ShowNotification(_U("enter_office_error"), "error") end Wait(1500) DoScreenFadeIn(1500) @@ -853,9 +853,9 @@ function OpenPMQuickMenu(Action) Wait(1500) ESX.TriggerServerCallback("esx_property:PMexitOffice", function(HasExited) if HasExited then - ESX.ShowNotification("~b~Exiting~s~ Office.", "success") + ESX.ShowNotification(_U("exit_office"), "success") else - ESX.ShowNotification("You ~r~Cannot~s~ Exit This Office!", "error") + ESX.ShowNotification(_U("exit_office_error"), "error") end Wait(1500) DoScreenFadeIn(1500) @@ -864,14 +864,14 @@ function OpenPMQuickMenu(Action) TriggerEvent("esx_property:AdminMenu") elseif Action == "ActionsMenu" then - local elements = {{unselectable = true, title = "Real Estate Actions", value = "RealEstateActions"}} + local elements = {{unselectable = true, title = _U("actions"), value = "RealEstateActions"}} if ESX.PlayerData.job.name == PM.job then if ESX.PlayerData.job.grade >= PM.Permissions.CreateProperty then - elements[#elements + 1] = {title = "Create Property", value = "CreateProperty"} + elements[#elements + 1] = {title = _U("property_create"), value = "CreateProperty"} end if ESX.PlayerData.job.grade >= PM.Permissions.ManagePropertiesFromQuickActions then - elements[#elements + 1] = {title = "Manage Properties", value = "manage"} + elements[#elements + 1] = {title = _U("property_manage"), value = "manage"} end end ESX.OpenContext("right", elements, function(menu, element) @@ -885,7 +885,7 @@ function OpenPMQuickMenu(Action) end end -ESX.RegisterInput("realestatequickmenu", "(ESX Property) Open Real Estate Quick Actions", "keyboard", "F5", function() +ESX.RegisterInput(_U("realestate_command"), _U("realestate_command_desc"), "keyboard", "F5", function() ESX.TriggerServerCallback('esx_property:IsAdmin', function(Access) if Access then OpenPMQuickMenu("ActionsMenu") @@ -914,7 +914,7 @@ CreateThread(function() if Dist <= 1.5 then if not PMdrawing[k] then PMdrawing[k] = true - ESX.TextUI("Press ~b~[E]~s~ to Access ~b~" .. k) + ESX.TextUI(_U("realestate_textui", k)) end if IsControlJustPressed(0, 38) then OpenPMQuickMenu(k) diff --git a/[esx_addons]/esx_property/locales/en.lua b/[esx_addons]/esx_property/locales/en.lua index 1ade1b85..2a1e32b5 100644 --- a/[esx_addons]/esx_property/locales/en.lua +++ b/[esx_addons]/esx_property/locales/en.lua @@ -64,5 +64,18 @@ Locales['en'] = { ["key_management"] = "Key Management", ["key_management_desc"] = "Control Property Access.", ["give_keys"] = "Give Keys", - ["remove_keys"] = "Remove Keys" + ["remove_keys"] = "Remove Keys", + + + --------- Real Estate Strings --------------- + ["actions"] = "Real Estate Actions", + ["property_create"] = "Create Property", + ["property_manage"] = "Manage Properties", + ["realestate_command"] = "realestatequickmenu", + ["realestate_command_desc"] = "(ESX Property) Open Real Estate Quick Actions", + ["enter_office"] = "~b~Entering~s~ Office.", + ["enter_office_error"] = "You ~r~Cannot~s~ Enter The Office!", + ["exit_office"] = "~b~Exiting~s~ Office.", + ["exit_office_error"] = "You ~r~Cannot~s~ Exit The Office!", + ["realestate_textui"] = "Press ~b~[E]~s~ to Access ~b~%s", } \ No newline at end of file