From 741114272a10a33f1844931686e074c3506e995b Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Sat, 25 Jul 2026 09:46:56 +0200 Subject: [PATCH] Translate the themes names --- client/render/ui_theme.cpp | 7 +++++++ client/render/ui_theme.h | 1 + client/scenes/lobby_gui_theme.cpp | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/client/render/ui_theme.cpp b/client/render/ui_theme.cpp index b39c95e7..f40650fa 100644 --- a/client/render/ui_theme.cpp +++ b/client/render/ui_theme.cpp @@ -18,6 +18,7 @@ */ #include "ui_theme.h" +#include "utils/i18n.h" namespace wivrn::ui { @@ -31,6 +32,7 @@ static theme dark_default() { theme t; t.name = "Dark"; + t.localized_name = _C("theme name", "Dark"); t.accent = rgb(30, 115, 255); t.accent_hovered = rgb(64, 140, 255); @@ -66,6 +68,7 @@ static theme midnight() { theme t = dark_default(); t.name = "Midnight"; + t.localized_name = _C("theme name", "Midnight"); t.background = rgb(6, 8, 16); t.card = rgb(16, 20, 34); t.card_hovered = rgb(22, 27, 44); @@ -80,6 +83,7 @@ static theme slate_light() { theme t = dark_default(); t.name = "Slate"; + t.localized_name = _C("theme name", "Slate"); t.background = rgb(28, 30, 36); t.card = rgb(38, 41, 49); t.card_hovered = rgb(46, 50, 60); @@ -97,6 +101,7 @@ static theme oled() { theme t = dark_default(); t.name = "OLED"; + t.localized_name = _C("theme name", "OLED"); t.background = rgb(0, 0, 0); t.card = rgb(6, 6, 8); t.card_hovered = rgb(11, 12, 14); @@ -112,6 +117,7 @@ static theme graphite() { theme t = dark_default(); t.name = "Graphite"; + t.localized_name = _C("theme name", "Graphite"); t.background = rgb(20, 21, 23); t.card = rgb(31, 33, 36); t.card_hovered = rgb(39, 41, 45); @@ -129,6 +135,7 @@ static theme light() { theme t = dark_default(); t.name = "Light"; + t.localized_name = _C("theme name", "Light"); t.background = rgb(188, 193, 202); t.card = rgb(252, 252, 253); t.card_hovered = rgb(242, 243, 246); diff --git a/client/render/ui_theme.h b/client/render/ui_theme.h index 41e598bd..349d74cd 100644 --- a/client/render/ui_theme.h +++ b/client/render/ui_theme.h @@ -29,6 +29,7 @@ namespace wivrn::ui struct theme { std::string name; + std::string localized_name; // Accent ImVec4 accent; diff --git a/client/scenes/lobby_gui_theme.cpp b/client/scenes/lobby_gui_theme.cpp index ef4adf66..88a22526 100644 --- a/client/scenes/lobby_gui_theme.cpp +++ b/client/scenes/lobby_gui_theme.cpp @@ -99,7 +99,7 @@ void scenes::lobby::gui_theme() const auto preset_list = ui::presets(); std::vector preset_items; for (const auto & p: preset_list) - preset_items.push_back({p.name.c_str()}); + preset_items.push_back({p.localized_name.c_str()}); // seed the selection from the saved preset so the box matches what is applied static int preset = [&] {