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 fa15142150)
This commit is contained in:
Iris Morelle 2018-04-18 21:10:59 -03:00
parent 85586adc07
commit ce675dd1db
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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<label>(&win, "revision_number", false, false)) {
version_label->set_label(version_string);