Add translation support for the new AI pre-game dialog changes. Closes ticket:2742

master
Per Inge Mathisen 2011-05-21 21:59:46 +02:00
parent 50764d1bee
commit 0892ed7b4c
1 changed files with 7 additions and 7 deletions

View File

@ -208,7 +208,7 @@ static int difficultyIcon(int difficulty);
// //////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////
// map previews.. // 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 }; static const int difficultyValue[] = { 1, 10, 15, 20 };
struct AIDATA struct AIDATA
@ -3740,7 +3740,7 @@ void displayPosition(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT
drawBlueBox(x, y, psWidget->width, psWidget->height); drawBlueBox(x, y, psWidget->width, psWidget->height);
iV_SetFont(font_regular); iV_SetFont(font_regular);
iV_SetTextColour(WZCOL_FORM_TEXT); 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); 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 x = xOffset + psWidget->x;
const int y = yOffset + psWidget->y; const int y = yOffset + psWidget->y;
const int j = psWidget->UserData; const int j = psWidget->UserData;
const char *commsText[] = { "Open", "Closed" }; const char *commsText[] = { N_("Open"), N_("Closed") };
drawBlueBox(x, y, psWidget->width, psWidget->height); drawBlueBox(x, y, psWidget->width, psWidget->height);
iV_SetFont(font_regular); iV_SetFont(font_regular);
iV_SetTextColour(WZCOL_FORM_TEXT); 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) static int difficultyIcon(int difficulty)
@ -3780,7 +3780,7 @@ static void displayDifficulty(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset,
iV_SetFont(font_regular); iV_SetFont(font_regular);
iV_SetTextColour(WZCOL_FORM_TEXT); iV_SetTextColour(WZCOL_FORM_TEXT);
iV_DrawImage(FrontImages, difficultyIcon(j), x + 5, y + 5); 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"); ASSERT_OR_RETURN(, NetPlay.players[j].ai < (int)aidata.size(), "Uh-oh, AI index out of bounds");
switch (NetPlay.players[j].ai) switch (NetPlay.players[j].ai)
{ {
case AI_OPEN: sstrcpy(aitext, "Open"); break; case AI_OPEN: sstrcpy(aitext, _("Open")); break;
case AI_CLOSED: sstrcpy(aitext, "Closed"); break; case AI_CLOSED: sstrcpy(aitext, _("Closed")); break;
default: sstrcpy(aitext, aidata[NetPlay.players[j].ai].name); break; default: sstrcpy(aitext, aidata[NetPlay.players[j].ai].name); break;
} }
iV_DrawText(aitext, x + nameX, y + 22); iV_DrawText(aitext, x + nameX, y + 22);