Skip to content
Permalink
Browse files

Add placeholder for "AUDIO / ZOOM OPTIONS" message

* add support for optional delimiter "\n" to show message on two lines
  so that it can be translated correctly within a 640x480 pixel window
  (that is, the minium screen resolution)
* only process the first delimiter, ignoring all others that may follow
* note that the messages's translation must not begin or end with "\n"
  (otherwise msgfmt will terminate with a fatal error)

Refs ticket:4629
Fixes #345
  • Loading branch information...
Forgon2100 committed Jan 1, 2019
1 parent ada00e5 commit bd0514fd6ff84f76ea9c0633523b68b45a9c90ca
Showing with 15 additions and 2 deletions.
  1. +14 −2 src/frontend.cpp
  2. +1 −0 src/frontend.h
@@ -921,8 +921,20 @@ static bool startAudioAndZoomOptionsMenu()
addMultiBut(psWScreen, FRONTEND_BOTFORM, FRONTEND_QUIT, 10, 10, 30, 29, P_("menu", "Return"), IMAGE_RETURN, IMAGE_RETURN_HI, IMAGE_RETURN_HI);

//add some text down the side of the form
addSideText(FRONTEND_SIDETEXT, FRONTEND_SIDEX, FRONTEND_SIDEY, _("AUDIO / ZOOM OPTIONS"));

// TRANSLATORS: "AUDIO" options determine the volume of game sounds.
// "OPTIONS" means "SETTINGS".
// To break this message into two lines, you can use the delimiter "\n",
// e.g. "AUDIO / ZOOM\nOPTIONS" would show "OPTIONS" in a second line.
WzString messageString = WzString::fromUtf8(_("AUDIO / ZOOM OPTIONS"));
std::vector<WzString> messageStringLines = messageString.split("\n");
addSideText(FRONTEND_SIDETEXT, FRONTEND_SIDEX, FRONTEND_SIDEY, messageStringLines[0].toUtf8().c_str());
// show a second sidetext line if the translation requires it
if (messageStringLines.size() > 1)
{
messageString.remove(0, messageStringLines[0].length() + 1);
addSideText(FRONTEND_MULTILINE_SIDETEXT, FRONTEND_SIDEX + 22, \
FRONTEND_SIDEY, messageString.toUtf8().c_str());
}

return true;
}
@@ -159,6 +159,7 @@ enum
FRONTEND_BOTFORM,
FRONTEND_LOGO,
FRONTEND_SIDETEXT, // sideways text
FRONTEND_MULTILINE_SIDETEXT, // sideways text
FRONTEND_SIDETEXT1, // sideways text
FRONTEND_SIDETEXT2, // sideways text
FRONTEND_SIDETEXT3, // sideways text

0 comments on commit bd0514f

Please sign in to comment.
You can’t perform that action at this time.