Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Localize error messages in mainmenu (#11495)
Co-authored-by: sfan5 <sfan5@live.de> Co-authored-by: rubenwardy <rw@rubenwardy.com>
- Loading branch information
1 parent
6910c8d
commit 693f983
Showing
8 changed files
with
97 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include "test.h" | ||
#include "porting.h" | ||
#include "gettext.h" | ||
|
||
class TestGettext : public TestBase | ||
{ | ||
public: | ||
TestGettext() { | ||
TestManager::registerTestModule(this); | ||
} | ||
|
||
const char *getName() { return "TestGettext"; } | ||
|
||
void runTests(IGameDef *gamedef); | ||
|
||
void testSnfmtgettext(); | ||
void testFmtgettext(); | ||
}; | ||
|
||
static TestGettext g_test_instance; | ||
|
||
void TestGettext::runTests(IGameDef *gamedef) | ||
{ | ||
TEST(testFmtgettext); | ||
} | ||
|
||
void TestGettext::testFmtgettext() | ||
{ | ||
std::string buf = fmtgettext("Viewing range changed to %d", 12); | ||
UASSERTEQ(std::string, buf, "Viewing range changed to 12"); | ||
buf = fmtgettext( | ||
"You are about to join this server with the name \"%s\" for the " | ||
"first time.\n" | ||
"If you proceed, a new account using your credentials will be " | ||
"created on this server.\n" | ||
"Please retype your password and click 'Register and Join' to " | ||
"confirm account creation, or click 'Cancel' to abort." | ||
, "A"); | ||
UASSERTEQ(std::string, buf, | ||
"You are about to join this server with the name \"A\" for the " | ||
"first time.\n" | ||
"If you proceed, a new account using your credentials will be " | ||
"created on this server.\n" | ||
"Please retype your password and click 'Register and Join' to " | ||
"confirm account creation, or click 'Cancel' to abort." | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters