Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix version string being printed in wrong language
Updating the version string each time before it gets printed ensures it
is written in the correct language if the game's language
* differs from the system locale
* is changed via the "Options" -> "Game Options" screen

Fixes #344
  • Loading branch information
Forgon2100 authored and KJeff01 committed May 10, 2019
1 parent 224a92a commit 4236886
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/version.cpp
Expand Up @@ -110,26 +110,26 @@ const char *version_getFormattedVersionString()
{
static char versionString[MAX_STR_LENGTH] = {'\0'};

if (versionString[0] == '\0')
{
// Compose the working copy state string
// Compose the working copy state string
#if (VCS_WC_MODIFIED)
const char *wc_state = _(" (modified locally)");
// TRANSLATORS: Printed when compiling with uncommitted changes
const char *wc_state = _(" (modified locally)");
#else
const char *wc_state = "";
const char *wc_state = "";
#endif
// Compose the build type string
// Compose the build type string
#ifdef DEBUG
const char *build_type = _(" - DEBUG");
// TRANSLATORS: Printed in Debug builds
const char *build_type = _(" - DEBUG");
#else
const char *build_type = "";
const char *build_type = "";
#endif
// Construct the version string
// TRANSLATORS: This string looks as follows when expanded.
// "Version: <version name/number>, <working copy state>,
// Built: <BUILD DATE><BUILD TYPE>"
snprintf(versionString, MAX_STR_LENGTH, _("Version: %s,%s Built: %s%s"), version_getVersionString(), wc_state, getCompileDate(), build_type);
}

// Construct the version string
// TRANSLATORS: This string looks as follows when expanded.
// "Version: <version name/number>, <working copy state>,
// Built: <BUILD DATE><BUILD TYPE>"
snprintf(versionString, MAX_STR_LENGTH, _("Version: %s,%s Built: %s%s"), version_getVersionString(), wc_state, getCompileDate(), build_type);

return versionString;
}

0 comments on commit 4236886

Please sign in to comment.