Skip to content

Commit

Permalink
gui2/title_screen: Make Version label formatted and translatable
Browse files Browse the repository at this point in the history
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 fa15142)
  • Loading branch information
irydacea committed Oct 7, 2018
1 parent 85586ad commit ce675dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.md
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/gui/dialogs/title_screen.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ce675dd

Please sign in to comment.