diff --git a/src/core/libraries/np_trophy/trophy_ui.cpp b/src/core/libraries/np_trophy/trophy_ui.cpp index acdc1f74a..6daae24ef 100644 --- a/src/core/libraries/np_trophy/trophy_ui.cpp +++ b/src/core/libraries/np_trophy/trophy_ui.cpp @@ -118,7 +118,7 @@ void TrophyUI::Draw() { ImGui::Indent(60); } - const std::string combinedString = "Trophy earned!\n%s" + trophy_name; + const std::string combinedString = tr("Trophy earned!").toStdString() + "\n" + trophy_name; const float wrap_width = CalcWrapWidthForPos(GetCursorScreenPos(), (window_size.x - (60 * AdjustWidth))); SetWindowFontScale(1.2 * AdjustHeight); @@ -135,7 +135,7 @@ void TrophyUI::Draw() { SetCursorPosY((window_size.y - text_height) * 0.5); } ImGui::PushTextWrapPos(window_size.x - (60 * AdjustWidth)); - TextWrapped("Trophy earned!\n%s", trophy_name.c_str()); + TextWrapped("%s", combinedString.c_str()); ImGui::SameLine(window_size.x - (60 * AdjustWidth)); if (trophy_icon) { diff --git a/src/core/libraries/np_trophy/trophy_ui.h b/src/core/libraries/np_trophy/trophy_ui.h index 16e707059..b09f59ba4 100644 --- a/src/core/libraries/np_trophy/trophy_ui.h +++ b/src/core/libraries/np_trophy/trophy_ui.h @@ -13,9 +13,12 @@ #include "imgui/imgui_layer.h" #include "imgui/imgui_texture.h" +#include + namespace Libraries::NpTrophy { -class TrophyUI final : public ImGui::Layer { +class TrophyUI final : public QObject, public ImGui::Layer { + Q_OBJECT public: TrophyUI(const std::filesystem::path& trophyIconPath, const std::string& trophyName, const std::string_view& rarity); diff --git a/src/qt_gui/translations/en_US.ts b/src/qt_gui/translations/en_US.ts index fb66e9f94..fb7d3382a 100644 --- a/src/qt_gui/translations/en_US.ts +++ b/src/qt_gui/translations/en_US.ts @@ -887,6 +887,13 @@ + + Libraries::NpTrophy::TrophyUI + + Trophy earned! + Trophy earned! + + MainWindow