From 2a1c51c528acfc55f298f82347a189be9130d1f3 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 26 Aug 2022 17:21:16 +0100 Subject: [PATCH] feat: esx_property - Client Keys Translations --- [esx_addons]/esx_property/client/main.lua | 20 ++++++++++---------- [esx_addons]/esx_property/locales/en.lua | 13 +++++++++++-- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/[esx_addons]/esx_property/client/main.lua b/[esx_addons]/esx_property/client/main.lua index 73eedd5a..5923fe90 100644 --- a/[esx_addons]/esx_property/client/main.lua +++ b/[esx_addons]/esx_property/client/main.lua @@ -154,7 +154,7 @@ end function GiveKeysMenu(Property) ESX.TriggerServerCallback("esx_property:GetInsidePlayers", function(Players) - local Elements = {{unselectable = true, title = "Nearby Players", icon = "fas fa-user-plus"}, + local Elements = {{unselectable = true, title = _U("nearby"), icon = "fas fa-user-plus"}, {title = _U("back"), icon = "fas fa-arrow-left", value = "go_back"}} for i = 1, #Players, 1 do Elements[#Elements + 1] = {title = Players[i].Name, icon = "far fa-user", index = Players[i].Id, value = "user"} @@ -165,10 +165,10 @@ function GiveKeysMenu(Property) elseif element.value == "user" then ESX.TriggerServerCallback("esx_property:GiveKey", function(KeyGiven) if KeyGiven then - ESX.ShowNotification("You gave a key to ~b~" .. element.title .. "~s~.", "success") + ESX.ShowNotification(_U("gave_key",element.title), "success") ESX.CloseContext() else - ESX.ShowNotification("You Cannot Give This Player A ~r~Key", "error") + ESX.ShowNotification(_U("key_cannot_give"), "error") end end, Property, element.index) end @@ -178,7 +178,7 @@ end function RemoveKeysMenu(Property) ESX.TriggerServerCallback("esx_property:GetPlayersWithKeys", function(Players) - local Elements = {{unselectable = true, title = "Remove Key From Player", icon = "fas fa-user-plus"}, + local Elements = {{unselectable = true, title = _U("remove_title"), icon = "fas fa-user-plus"}, {title = _U("back"), icon = "fas fa-arrow-left", value = "go_back"}} for k, v in pairs(Players) do local name = v.name @@ -191,10 +191,10 @@ function RemoveKeysMenu(Property) elseif element.value == "user" then ESX.TriggerServerCallback("esx_property:RemoveKey", function(KeyGiven) if KeyGiven then - ESX.ShowNotification("You Revoked ~b~" .. element.title .. "~s~`s Property Access.", "success") + ESX.ShowNotification(_U("key_revoke_success", element.title), "success") ESX.CloseContext() else - ESX.ShowNotification("You Cannot ~b~Remove~s~ A ~r~Key~s~ From this Person", "error") + ESX.ShowNotification(_U("key_revoke_error"), "error") end end, Property, element.id) end @@ -204,10 +204,10 @@ end function ManageKeys(Property) ESX.HideUI() - local Elements = {{unselectable = true, title = "Key Management", icon = "fas fa-key"}, + local Elements = {{unselectable = true, title = _U("key_management"), icon = "fas fa-key"}, {title = _U("back"), icon = "fas fa-arrow-left", value = "go_back"}, - {title = "Give Keys", icon = "fas fa-plus", value = "give_keys"}, - {title = "Remove Keys", icon = "fas fa-minus", value = "remove_keys"}} + {title = _U("give_keys"), icon = "fas fa-plus", value = "give_keys"}, + {title = _U("remove_keys"), icon = "fas fa-minus", value = "remove_keys"}} ESX.OpenContext("right", Elements, function(menu, element) if element.value == "go_back" then @@ -259,7 +259,7 @@ function PropertyMenuElements(PropertyId) end if not InProperty then if ESX.PlayerData.identifier == Property.Owner then - table.insert(elements, {title = "Manage Keys", description = "Give And Remove Property Access.", icon = "fas fa-key", value = 'property_keys'}) + table.insert(elements, {title = _U("key_management"), description = _U("key_management_desc"), icon = "fas fa-key", value = 'property_keys'}) table.insert(elements, {title = "Sell", description = "Sell This Property For $" .. ESX.Math.GroupDigits(ESX.Round(Property.Price * 0.6)), icon = "fas fa-dollar-sign", value = 'property_sell'}) diff --git a/[esx_addons]/esx_property/locales/en.lua b/[esx_addons]/esx_property/locales/en.lua index 2d76fa3a..1ade1b85 100644 --- a/[esx_addons]/esx_property/locales/en.lua +++ b/[esx_addons]/esx_property/locales/en.lua @@ -54,6 +54,15 @@ Locales['en'] = { ["already_has"] = "This Player Already Has Keys!", ["do_not_own"] = 'You do ~r~not~s~ own this property.', ["key_revoked"] = 'Your Key Access To ~b~%s~s~. Has Been ~r~Revoked~s~', - ["no_keys"] = "This Player Does Not Have Keys!" - + ["no_keys"] = "This Player Does Not Have Keys!", + ["nearby"] = "Nearby Players", + ["gave_key"] = "Giving Keys to %s!", + ["key_cannot_give"] = "You Cannot Give This Player A ~r~Key", + ["remove_title"] = "Remove Keys From Player", + ["key_revoke_success"] = "Revoking Keys From ~b~%s~s~.", + ["key_revoke_error"] = "You Cannot ~b~Remove~s~ A ~r~Key~s~ From this Person", + ["key_management"] = "Key Management", + ["key_management_desc"] = "Control Property Access.", + ["give_keys"] = "Give Keys", + ["remove_keys"] = "Remove Keys" } \ No newline at end of file