From ce675dd1db1e6796b9556737b50d49223854fd32 Mon Sep 17 00:00:00 2001 From: Iris Morelle Date: Wed, 18 Apr 2018 21:10:59 -0300 Subject: [PATCH] gui2/title_screen: Make Version label formatted and translatable Closes #2914. This doesn't break the string freeze since it reuses a format string from the same textdomain required by gui2/game_version for the exact same purpose. (cherry-picked from commit fa15142150983162707c7455ae5cc5e917029e96) --- changelog.md | 1 + src/gui/dialogs/title_screen.cpp | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index e67618bf66ab..c583cdb4ead4 100644 --- a/changelog.md +++ b/changelog.md @@ -33,6 +33,7 @@ * Fixed "Search" placeholder text in dialog item filters not being translatable (bug #2709, bug #2732). * Fixed Logging Options tooltips not being translatable (bug #2837). + * Fixed Version label on the title screen not being translatable (issue #2914). * Updated translations: British English, Chinese (Simplified), Czech, French, Galician, Italian, Polish, Scottish Gaelic, Slovak, Spanish, Ukrainian ### Lua API diff --git a/src/gui/dialogs/title_screen.cpp b/src/gui/dialogs/title_screen.cpp index 64834fdb2dd0..33c7194bf6d2 100644 --- a/src/gui/dialogs/title_screen.cpp +++ b/src/gui/dialogs/title_screen.cpp @@ -17,11 +17,10 @@ #include "gui/dialogs/title_screen.hpp" #include "addon/manager_ui.hpp" -#include "formatter.hpp" +#include "formula/string_utils.hpp" #include "game_config.hpp" #include "game_config_manager.hpp" #include "game_launcher.hpp" -#include "gettext.hpp" #include "gui/auxiliary/find_widget.hpp" #include "gui/auxiliary/tips.hpp" #include "gui/core/timer.hpp" @@ -239,7 +238,7 @@ void title_screen::pre_show(window& win) // // Version string // - const std::string version_string = formatter() << ("Version") << " " << game_config::revision; + const std::string& version_string = VGETTEXT("Version $version", {{ "version", game_config::revision }}); if(label* version_label = find_widget