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.
This commit is contained in:
Iris Morelle 2018-04-18 21:10:59 -03:00
parent 5ffd747081
commit 91de2a4c98
2 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,6 @@
## Version 1.13.14+dev
### Language and i18n
* Fixed Version label on the title screen not being translatable (issue #2914).
* Updated translations: French, Galician, Slovak
### Multiplayer
* Fixed regression causing a crash-to-desktop when trying to log into the

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);