From 0892ed7b4cd071d7c2d185924744c1a1392fd354 Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Sat, 21 May 2011 21:59:46 +0200 Subject: [PATCH] Add translation support for the new AI pre-game dialog changes. Closes ticket:2742 --- src/multiint.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/multiint.cpp b/src/multiint.cpp index f017f21dc..160ba1bf5 100644 --- a/src/multiint.cpp +++ b/src/multiint.cpp @@ -208,7 +208,7 @@ static int difficultyIcon(int difficulty); // //////////////////////////////////////////////////////////////////////////// // map previews.. -static const char *difficultyList[] = { "Easy", "Medium", "Hard", "Insane" }; +static const char *difficultyList[] = { N_("Easy"), N_("Medium"), N_("Hard"), N_("Insane") }; static const int difficultyValue[] = { 1, 10, 15, 20 }; struct AIDATA @@ -3740,7 +3740,7 @@ void displayPosition(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT drawBlueBox(x, y, psWidget->width, psWidget->height); iV_SetFont(font_regular); iV_SetTextColour(WZCOL_FORM_TEXT); - ssprintf(text, "Click to take player slot %d", NetPlay.players[i].position); + ssprintf(text, _("Click to take player slot %d"), NetPlay.players[i].position); iV_DrawText(text, x + 10, y + 22); } @@ -3749,12 +3749,12 @@ static void displayAi(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT const int x = xOffset + psWidget->x; const int y = yOffset + psWidget->y; const int j = psWidget->UserData; - const char *commsText[] = { "Open", "Closed" }; + const char *commsText[] = { N_("Open"), N_("Closed") }; drawBlueBox(x, y, psWidget->width, psWidget->height); iV_SetFont(font_regular); iV_SetTextColour(WZCOL_FORM_TEXT); - iV_DrawText((j >= 0) ? aidata[j].name : commsText[j + 2], x + 10, y + 22); + iV_DrawText((j >= 0) ? aidata[j].name : gettext(commsText[j + 2]), x + 10, y + 22); } static int difficultyIcon(int difficulty) @@ -3780,7 +3780,7 @@ static void displayDifficulty(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, iV_SetFont(font_regular); iV_SetTextColour(WZCOL_FORM_TEXT); iV_DrawImage(FrontImages, difficultyIcon(j), x + 5, y + 5); - iV_DrawText(difficultyList[j], x + 42, y + 22); + iV_DrawText(gettext(difficultyList[j]), x + 42, y + 22); } // //////////////////////////////////////////////////////////////////////////// @@ -3942,8 +3942,8 @@ void displayPlayer(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *p ASSERT_OR_RETURN(, NetPlay.players[j].ai < (int)aidata.size(), "Uh-oh, AI index out of bounds"); switch (NetPlay.players[j].ai) { - case AI_OPEN: sstrcpy(aitext, "Open"); break; - case AI_CLOSED: sstrcpy(aitext, "Closed"); break; + case AI_OPEN: sstrcpy(aitext, _("Open")); break; + case AI_CLOSED: sstrcpy(aitext, _("Closed")); break; default: sstrcpy(aitext, aidata[NetPlay.players[j].ai].name); break; } iV_DrawText(aitext, x + nameX, y + 22);