diff --git a/include/NazaraEditor/Core/UI/PopupManager.hpp b/include/NazaraEditor/Core/UI/PopupManager.hpp index 75ffdd1..208551d 100644 --- a/include/NazaraEditor/Core/UI/PopupManager.hpp +++ b/include/NazaraEditor/Core/UI/PopupManager.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -11,11 +12,11 @@ namespace Nz { struct Choice { - std::string name; + Nz::LocalizedText name; std::function callback; }; - std::string title; - std::string description; + Nz::LocalizedText title; + Nz::LocalizedText description; std::vector choices; }; diff --git a/src/NazaraEditor/Core/Application/Actions/EditorAction_Level.cpp b/src/NazaraEditor/Core/Application/Actions/EditorAction_Level.cpp index 7d55ec1..f18068d 100644 --- a/src/NazaraEditor/Core/Application/Actions/EditorAction_Level.cpp +++ b/src/NazaraEditor/Core/Application/Actions/EditorAction_Level.cpp @@ -7,15 +7,15 @@ namespace Nz void EditorAction_Level_New::Execute() { Nz::EditorBaseApplication::Instance()->GetPopupManager().CreatePopup({ - .title = "Warning", - .description = "Are you sure you want to create a new level?", + .title = "LOC_EDITOR_POPUP_CREATE_LEVEL_TITLE", + .description = "LOC_EDITOR_POPUP_CREATE_LEVEL_DESC", .choices = { { - .name = "Yes", + .name = "LOC_EDITOR_YES", .callback = []() { Nz::EditorBaseApplication::Instance()->NewLevel(); } }, { - .name = "No" + .name = "LOC_EDITOR_NO" } } }); diff --git a/src/NazaraEditor/Core/UI/PopupManager.cpp b/src/NazaraEditor/Core/UI/PopupManager.cpp index ff275e0..b4f3c46 100644 --- a/src/NazaraEditor/Core/UI/PopupManager.cpp +++ b/src/NazaraEditor/Core/UI/PopupManager.cpp @@ -18,8 +18,10 @@ namespace Nz void EditorPopup::OnRenderImgui() { - ImGui::OpenPopup(m_parameters.title.c_str()); - if (ImGui::BeginPopupModal(m_parameters.title.c_str(), nullptr, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse)) + std::string name = std::format("{}###{}", m_parameters.title.ToString(), m_parameters.title.GetBaseString()); + + ImGui::OpenPopup(name.c_str()); + if (ImGui::BeginPopupModal(name.c_str(), nullptr, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse)) { ImGui::Text(m_parameters.description.c_str());