From 32af745eb9eb7acb4e9a27a929dee3c28e822c96 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sun, 20 Apr 2025 13:09:08 +0300 Subject: [PATCH] feat: translated textbox hints support --- src/graphics/ui/gui_xml.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/graphics/ui/gui_xml.cpp b/src/graphics/ui/gui_xml.cpp index 151d1239..80512bc5 100644 --- a/src/graphics/ui/gui_xml.cpp +++ b/src/graphics/ui/gui_xml.cpp @@ -434,6 +434,11 @@ static std::shared_ptr read_text_box( auto placeholder = util::str2wstr_utf8(element.attr("placeholder", "").getText()); auto hint = util::str2wstr_utf8(element.attr("hint", "").getText()); + if (!hint.empty() && hint[0] == '@') { + hint = langs::get( + hint.substr(1), util::str2wstr_utf8(reader.getContext()) + ); + } auto text = parse_inner_text(element, reader.getContext()); auto textbox = std::make_shared( reader.getGUI(), placeholder, glm::vec4(0.0f)