Translate level title and creator on-the-fly

These weren't getting updated when cycling language with CTRL+F8. This
is because they would be already baked. Luckily, at least the bool
keeping track of whether or not to translate them in the first place
already exists, so we can just rely on that.
This commit is contained in:
Misa
2024-02-02 15:58:46 -08:00
committed by Misa Elizabeth Kai
parent 0aea27f237
commit 53ed33039f
5 changed files with 52 additions and 31 deletions

View File

@@ -6638,6 +6638,11 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
prefix = "";
break;
}
const char* title = cl.ListOfMetaData[i].title.c_str();
if (cl.ListOfMetaData[i].title_is_gettext)
{
title = loc::gettext(title);
}
/* We have to make sure the stars and spaces are consistently on the
* correct side of the title, no matter what bidi characters are in there.
* So just always let the bidi engine handle it, with a few control chars. */
@@ -6650,7 +6655,7 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
prefix,
// FIRST STRONG ISOLATE, to start an isolated block oriented however bidi sees fit
UTF8_encode(0x2068).bytes,
cl.ListOfMetaData[i].title.c_str(),
title,
// POP DIRECTIONAL ISOLATE, exit isolated level title
UTF8_encode(0x2069).bytes
);