mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
Merge pull request #709 from TheFantomas/main
Fix shitty multicharacter locales :(
This commit is contained in:
@@ -110,7 +110,7 @@ if ESX.GetConfig().Multichar then
|
||||
if Characters[index] then
|
||||
local skin = Characters[index].skin or Config.Default
|
||||
if not Characters[index].model then
|
||||
if Characters[index].sex == _('female') then skin.sex = 1 else skin.sex = 0 end
|
||||
if Characters[index].sex == TranslateCap('female') then skin.sex = 1 else skin.sex = 0 end
|
||||
end
|
||||
TriggerEvent('skinchanger:loadSkin', skin)
|
||||
end
|
||||
@@ -142,14 +142,14 @@ if ESX.GetConfig().Multichar then
|
||||
end
|
||||
|
||||
function CharacterOptions(Characters, slots, SelectedCharacter)
|
||||
local elements = {{title = "Character: ".. Characters[SelectedCharacter.value].firstname .. " ".. Characters[SelectedCharacter.value].lastname,icon = "fa-regular fa-user", unselectable = true},
|
||||
{title = "Return", unselectable = false,icon = "fa-solid fa-arrow-left",description ="Return To Character Selection.", action = "return"}}
|
||||
local elements = {{title = TranslateCap('character', Characters[SelectedCharacter.value].firstname .. " ".. Characters[SelectedCharacter.value].lastname),icon = "fa-regular fa-user", unselectable = true},
|
||||
{title = TranslateCap('return'), unselectable = false,icon = "fa-solid fa-arrow-left",description = TranslateCap('return_description'), action = "return"}}
|
||||
if not Characters[SelectedCharacter.value].disabled then
|
||||
elements[3] = {title = _('char_play'), description ="Continue Into The City.", icon ="fa-solid fa-play",action = 'play', value = SelectedCharacter.value}
|
||||
elements[3] = {title = TranslateCap('char_play'), description = TranslateCap('char_play_description'), icon ="fa-solid fa-play",action = 'play', value = SelectedCharacter.value}
|
||||
else
|
||||
elements[3] = {title = _('char_disabled'), value = SelectedCharacter.value, icon ="fa-solid fa-xmark", description ="This Character Is Unusable.",}
|
||||
elements[3] = {title = TranslateCap('char_disabled'), value = SelectedCharacter.value, icon ="fa-solid fa-xmark", description = TranslateCap('char_disabled_description'),}
|
||||
end
|
||||
if Config.CanDelete then elements[4] = {title = _('char_delete'),icon ="fa-solid fa-xmark",description ="Permanently Remove This Character.", action = 'delete', value = SelectedCharacter.value} end
|
||||
if Config.CanDelete then elements[4] = {title = TranslateCap('char_delete'),icon ="fa-solid fa-xmark",description = TranslateCap('char_delete_description'), action = 'delete', value = SelectedCharacter.value} end
|
||||
ESX.OpenContext("left", elements, function(element, Action)
|
||||
if Action.action == "play" then
|
||||
SendNUIMessage({
|
||||
@@ -169,7 +169,7 @@ if ESX.GetConfig().Multichar then
|
||||
|
||||
function SelectCharacterMenu(Characters, slots)
|
||||
local Character = next(Characters)
|
||||
local elements = {{title = _('select_char') , icon = "fa-solid fa-users", description = _('select_char_description') , unselectable = true}}
|
||||
local elements = {{title = TranslateCap('select_char') , icon = "fa-solid fa-users", description = TranslateCap('select_char_description') , unselectable = true}}
|
||||
for k,v in pairs(Characters) do
|
||||
if not v.model and v.skin then
|
||||
if v.skin.model then v.model = v.skin.model elseif v.skin.sex == 1 then v.model = mp_f_freemode_01 else v.model = mp_m_freemode_01 end
|
||||
@@ -183,7 +183,7 @@ if ESX.GetConfig().Multichar then
|
||||
end
|
||||
end
|
||||
if #elements - 1 < slots then
|
||||
elements[#elements+1] = {title = _('create_char'), icon = "fa-solid fa-plus", value = (#elements+1), new = true}
|
||||
elements[#elements+1] = {title = TranslateCap('create_char'), icon = "fa-solid fa-plus", value = (#elements+1), new = true}
|
||||
end
|
||||
|
||||
ESX.OpenContext("left", elements, function(menu, SelectedCharacter)
|
||||
|
||||
@@ -1,26 +1,29 @@
|
||||
Locales['cs'] = {
|
||||
['male'] = "Muž",
|
||||
['female'] = "Žena",
|
||||
['delete_label'] = "Vymazat %s %s?",
|
||||
["male"] = "Muž",
|
||||
["female"] = "Žena",
|
||||
['select_char'] = "Zvolit Postavu",
|
||||
["select_char_description"] = "Select a character to play as.",
|
||||
["select_char_description"] = "Zvol si postavu za kterou budeš hrát.",
|
||||
['create_char'] = "Vytvořit Novou Postavu",
|
||||
['char_play'] = "Hrát za postavu",
|
||||
["char_play_description"] = "Pokračovat do města.",
|
||||
['char_disabled'] = "Tato postava je zakázána!",
|
||||
["char_disabled_description"] = "Tuto postavu nemůžeš používat.",
|
||||
['char_delete'] = "Vymazat postavu",
|
||||
['cancel'] = "Zrušit",
|
||||
['confirm'] = "Potvrdit",
|
||||
['command_setslots'] = "Nastavit slot pro hráče v multicharacteru",
|
||||
['command_remslots'] = "Odebrat slot pro hráče v multicharacteru",
|
||||
['command_enablechar'] = "Povolit zovlený slot hráči",
|
||||
['command_disablechar'] = "Zakázat zvolený slot pro hračé",
|
||||
["char_delete_description"] = "Na vždy smazat tuto postavu.",
|
||||
["character"] = "Postava: %s",
|
||||
["return"] = "Zpět",
|
||||
["return_description"] = "Vrátit se na vybírání postav.",
|
||||
['command_setslots'] = "Nastavit sloty pro hráče v multicharacteru",
|
||||
['command_remslots'] = "Odebrat sloty pro hráče v multicharacteru",
|
||||
['command_enablechar'] = "Povolit zvolený slot hráči",
|
||||
['command_disablechar'] = "Zakázat zvolený slot pro hrače",
|
||||
['command_charslot'] = "Číslo slotu",
|
||||
['command_identifier'] = "Identifier hráče",
|
||||
['command_slots'] = "# ze slotu",
|
||||
['slotsadd'] = "Přidal slot %s hráči %s",
|
||||
['slotsedit'] = "Nastavil si slot %s hráči %s",
|
||||
['slotsrem'] = "Odebral si slot %s",
|
||||
['charenabled'] = "Povolol si postavu #%s z %s",
|
||||
['charenabled'] = "Povolil si postavu #%s z %s",
|
||||
['chardisabled'] = "Zakázal si postavu #%s z %s",
|
||||
['charnotfound'] = "Postava #%s z %s nebyla nalezena/neexistuje",
|
||||
}
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
Locales["en"] = {
|
||||
["male"] = "Male",
|
||||
["female"] = "Female",
|
||||
["delete_label"] = "Delete %s %s?",
|
||||
["select_char"] = "Select Character",
|
||||
["select_char_description"] = "Select a character to play as.",
|
||||
["create_char"] = "New Character",
|
||||
["char_play"] = "Play",
|
||||
["char_play_description"] = "Continue Into The City.",
|
||||
["char_disabled"] = "Disabled",
|
||||
["char_disabled_description"] = "This Character Is Unusable.",
|
||||
["char_delete"] = "Delete",
|
||||
["cancel"] = "Cancel",
|
||||
["confirm"] = "Confirm",
|
||||
["char_delete_description"] = "Permanently Remove This Character.",
|
||||
["character"] = "Character: %s",
|
||||
["return"] = "Return",
|
||||
["return_description"] = "Return To Character Selection.",
|
||||
["command_setslots"] = "Set multicharacter slots number of a player",
|
||||
["command_remslots"] = "Remove multicharacter slots number of a player",
|
||||
["command_enablechar"] = "Enable a given character of a player",
|
||||
|
||||
@@ -81,7 +81,7 @@ elseif ESX.GetConfig().Multichar == true then
|
||||
dateofbirth = v.dateofbirth,
|
||||
skin = v.skin and json.decode(v.skin) or {},
|
||||
disabled = v.disabled,
|
||||
sex = v.sex == 'm' and _('male') or _('female')
|
||||
sex = v.sex == 'm' and TranslateCap('male') or TranslateCap('female')
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user