diff --git a/src/bullet.c b/src/bullet.c index 3fc0da2..b0a89dc 100644 --- a/src/bullet.c +++ b/src/bullet.c @@ -37,7 +37,7 @@ void bullet_add(Object *theWeapon, Object *attacker, int y, int dy) bullet = malloc(sizeof(*bullet)); if (bullet == NULL) { - engine_warn("Failed to allocate memor for bullet"); + engine_warn("Failed to allocate memory for bullet"); return; } diff --git a/src/cargo.c b/src/cargo.c index 51135f9..76d3297 100644 --- a/src/cargo.c +++ b/src/cargo.c @@ -82,7 +82,9 @@ void cargo_becomeCollectable(int i) aliens[ALIEN_PHOEBE].active = 1; aliens[ALIEN_PHOEBE].x = cargo[i].x; aliens[ALIEN_PHOEBE].y = cargo[i].y; - radio_setMessage(FS_PHOEBE, "Thanks! Watch out, WEAPCO! Phoebe's loose and she's ANGRY!", 1); + /// Dialog (Phoebe Lexx) + /// Used when Phoebe is freed in the Nerod mission. + radio_setMessage(FS_PHOEBE, _("Thanks! Watch out, WEAPCO! Phoebe's loose and she's ANGRY!"), 1); } cargo[i].active = 0; diff --git a/src/cutscene.c b/src/cutscene.c index 9d29e61..08c2e8f 100644 --- a/src/cutscene.c +++ b/src/cutscene.c @@ -493,6 +493,7 @@ void cutscene_init(int scene) if ((showMessage) && (gfx_messageBox != NULL)) screen_blit(gfx_messageBox, (screen->w - gfx_messageBox->w) / 2, screen->h - 100); + /// Instructions for how to skip the current cutscene screen_renderUnicode(_("Press [Escape] to skip"), -1, screen->h - 20, FONT_WHITE); game_delayFrame(); diff --git a/src/game.c b/src/game.c index a8ab66a..7261677 100644 --- a/src/game.c +++ b/src/game.c @@ -2294,19 +2294,24 @@ void game_getDifficultyText(char *dest, int difficulty) switch (difficulty) { case DIFFICULTY_EASY: - strcpy(dest, "Easy"); + /// DIFFICULTY_EASY + strcpy(dest, _("Easy")); break; case DIFFICULTY_NORMAL: - strcpy(dest, "Normal"); + /// DIFFICULTY_NORMAL + strcpy(dest, _("Normal")); break; case DIFFICULTY_HARD: - strcpy(dest, "Hard"); + /// DIFFICULTY_HARD + strcpy(dest, _("Hard")); break; case DIFFICULTY_NIGHTMARE: - strcpy(dest, "Nightmare!"); + /// DIFFICULTY_NIGHTMARE + strcpy(dest, _("Nightmare!")); break; case DIFFICULTY_ORIGINAL: - strcpy(dest, "Classic"); + /// DIFFICULTY_ORIGINAL (Classic) + strcpy(dest, _("Classic")); break; default: strcpy(dest, "???"); diff --git a/src/intermission.c b/src/intermission.c index e072c6d..3be3469 100644 --- a/src/intermission.c +++ b/src/intermission.c @@ -209,7 +209,7 @@ void intermission_updateSystemStatus() intermission_planets[game.stationedPlanet].missionCompleted = 1; } - strcpy(game.destinationName, _("None")); + strcpy(game.destinationName, _("No Destination")); game.destinationPlanet = game.stationedPlanet; } @@ -238,24 +238,29 @@ static void intermission_setStatusLines() game_getDifficultyText(difficulty, game.difficulty); + /// Status Screen text /// Retain "%s" as-is. It is replaced with the current difficulty. sprintf(string, _("Difficulty : %s"), difficulty); gfx_createTextObject(TS_STATUS_DIFFICULTY, string, 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of shots fired. sprintf(string, _("Shots Fired : %d"), game.shots); gfx_createTextObject(TS_SHOTS_FIRED, string, 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of hits scored. sprintf(string, _("Hits Scored : %d"), game.hits); gfx_createTextObject(TS_HITS_SCORED, string, 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the firing accuracy as a percentage. /// Note: To use the "%" symbol, you must enter "%%", as you can see in /// the English version. sprintf(string, _("Accuracy : %d%%"), game.accuracy); gfx_createTextObject(TS_ACCURACY, string, 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of kills. sprintf(string, _("Enemies Killed by Others : %d"), game.totalOtherKills); gfx_createTextObject(TS_OTHER_KILLS, string, 0, 0, FONT_WHITE); @@ -266,30 +271,37 @@ static void intermission_setStatusLines() gfx_createTextObject(TS_CHRIS_HEADER, _("*** Chris ***"), 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of kills. sprintf(string, _("Enemies Killed : %d"), game.totalKills); gfx_createTextObject(TS_CHRIS_KILLS, string, 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of shield restores picked up. sprintf(string, _("Shield Restores Picked Up : %d"), game.shieldPickups); gfx_createTextObject(TS_CHRIS_SHIELD_PICKUPS, string, 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of plasma cells picked up. sprintf(string, _("Plasma Cells Picked Up : %d"), game.cellPickups); gfx_createTextObject(TS_CHRIS_PLASMA_PICKUPS, string, 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of rockets picked up. sprintf(string, _("Rockets Picked Up : %d"), game.rocketPickups); gfx_createTextObject(TS_CHRIS_ROCKET_PICKUPS, string, 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of powerups picked up. sprintf(string, _("Powerups Picked Up : %d"), game.powerups); gfx_createTextObject(TS_CHRIS_POWERUP_PICKUPS, string, 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of mines destroyed. sprintf(string, _("Mines Destroyed : %d"), game.minesKilled); gfx_createTextObject(TS_CHRIS_MINES_KILLED, string, 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of slaves rescued. sprintf(string, _("Slaves Rescued : %d"), game.slavesRescued); gfx_createTextObject(TS_CHRIS_SLAVES_RESCUED, string, 0, 0, FONT_WHITE); @@ -298,11 +310,13 @@ static void intermission_setStatusLines() { gfx_createTextObject(TS_PHOEBE_HEADER, _("*** Phoebe ***"), 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of kills. sprintf(string, _("Enemies Killed : %d"), game.wingMate1Kills); gfx_createTextObject(TS_PHOEBE_KILLS, string, 0, 0, FONT_WHITE); - /// Retain "%d" as-is. It is replaced with the number of ejections. + /// Retain + /// Status Screen text "%d" as-is. It is replaced with the number of ejections. sprintf(string, _("Ejections : %d"), game.wingMate1Ejects); gfx_createTextObject(TS_PHOEBE_DEATHS, string, 0, 0, FONT_WHITE); } @@ -315,12 +329,15 @@ static void intermission_setStatusLines() if (game.hasWingMate2) { + /// Status Screen text gfx_createTextObject(TS_URSULA_HEADER, _("*** Ursula ***"), 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of kills. sprintf(string, _("Enemies Killed : %d"), game.wingMate2Kills); gfx_createTextObject(TS_URSULA_KILLS, string, 0, 0, FONT_WHITE); + /// Status Screen text /// Retain "%d" as-is. It is replaced with the number of ejections. sprintf(string, _("Ejections : %d"), game.wingMate2Ejects); gfx_createTextObject(TS_URSULA_DEATHS, string, 0, 0, FONT_WHITE); @@ -334,6 +351,7 @@ static void intermission_setStatusLines() gfx_createTextObject(TS_STATUS_HEADER, _("Current Status"), 0, 0, FONT_WHITE); + /// Status Screen footer (indicates the total time the game has been played) /// "%ld" (which represents hours) and "%02ld" sequences (which /// represent minutes and seconds, respectively) must remain and /// stay in the same order relative to each other. The ":"s @@ -762,6 +780,8 @@ static void intermission_createCommsSurface(SDL_Surface *comms) gfx_drawRect(comms, 0, 0, comms->w - 1, comms->h - 1, 0x00, 0x00, 0x25); gfx_renderUnicode(_("+++ CURRENT MISSIONS +++"), -1, 15, FONT_GREEN, 0, comms); + /// Brief instructions for how to review a mission conversation, shown below the + /// CURRENT MISSIONS header. gfx_renderUnicode(_("click for info"), -1, 35, FONT_WHITE, 0, comms); yStart = 60; diff --git a/src/mission.c b/src/mission.c index e005229..7b8af60 100644 --- a/src/mission.c +++ b/src/mission.c @@ -607,13 +607,14 @@ void mission_checkTimer() mission.completed1[0] = OB_COMPLETED; mission_killAllEnemies(); engine.addAliens = -1; - info_setLine("*** All Primary Objectives Completed ***", FONT_GREEN); + info_setLine(_("*** All Primary Objectives Completed ***"), FONT_GREEN); } } static void mission_evaluate(int type, int id, int *completed, int *targetValue, int fontColor) { - char message[25]; + char message[STRMAX_SHORT]; + char fmt[STRMAX_SHORT]; if ((*targetValue <= 0) && (type != M_PROTECT_TARGET) && (type != M_PROTECT_PICKUP)) @@ -633,22 +634,26 @@ static void mission_evaluate(int type, int id, int *completed, int *targetValue, switch(type) { case M_COLLECT: + // FIXME: Add plural support switch(id) { case P_CASH: - sprintf(message, "Collect $%d more...", *targetValue); - if ((rand() % 2) == 0) - sprintf(message, "$%d more to go...", *targetValue); + radio_getRandomMessage(fmt, _( + "Collect $%d more...\n" + "$%d more to go...")) + sprintf(message, fmt, *targetValue); break; case P_CARGO: - sprintf(message, "Collect %d more...", *targetValue); - if ((rand() % 2) == 0) - sprintf(message, "%d more to go...", *targetValue); + radio_getRandomMessage(fmt, _( + "Collect %d more...\n" + "%d more to go...")) + sprintf(message, fmt, *targetValue); break; case P_ORE: - sprintf(message, "Collect %d more...", *targetValue); - if ((rand() % 2) == 0) - sprintf(message, "%d more to go...", *targetValue); + radio_getRandomMessage(fmt, _( + "Collect %d more...\n" + "%d more to go...")) + sprintf(message, fmt, *targetValue); break; } break; @@ -657,14 +662,14 @@ static void mission_evaluate(int type, int id, int *completed, int *targetValue, switch(id) { case P_CARGO: - sprintf(message, "Cargo pod destroyed!"); + sprintf(message, _("Cargo pod destroyed!")); if (game.area == MISN_CERADSE) // Get lectured by Sid /// Dialog (Sid Wilson) /// Used when a cargo pod is destroyed in the Ceradse mission. radio_setMessage(FS_SID, _("Chris, we needed that pod! I told you that we couldn't afford to lose a single one!"), 1); break; case P_ESCAPEPOD: - sprintf(message, "Escape Pod lost!"); + sprintf(message, _("Escape Pod lost!")); if (game.area == MISN_ODEON) // Get lectured by Phoebe { /// Dialog (Phoebe Lexx) @@ -701,14 +706,16 @@ static void mission_evaluate(int type, int id, int *completed, int *targetValue, case M_DESTROY_TARGET_TYPE: if ((*targetValue <= 10) || (*targetValue % 10 == 0)) { - if (CHANCE(0.5)) - sprintf(message, "%d more to go...", *targetValue); - else - sprintf(message, "Destroy %d more...", *targetValue); + // XXX: Plurals + radio_getRandomMessage(fmt, _( + "Destroy %d more...\n" + "%d more to go...")) + sprintf(message, *fmt, *targetValue); } break; case M_DISABLE_TARGET: - sprintf(message, "Disable %d more...", *targetValue); + // XXX: Plurals + sprintf(message, _("Disable %d more..."), *targetValue); break; } @@ -730,7 +737,7 @@ void mission_updateRequirements(int type, int id, int value) // you will automatically fail the mission(!) if ((type == M_DESTROY_TARGET_TYPE) && (id == CD_SID)) { - info_setLine("Sid has been killed!", FONT_RED); + info_setLine(_("Sid has been killed!"), FONT_RED); mission.completed1[0] = OB_JUST_FAILED; /// Dialog (Sid Wilson) /// Used when Sid is killed. @@ -784,7 +791,7 @@ void mission_updateRequirements(int type, int id, int value) { if (game.slavesRescued >= 250) { - info_setLine("*** Slaves Rescued - Mission Completed ***", FONT_GREEN); + info_setLine(_("*** Slaves Rescued - Mission Completed ***"), FONT_GREEN); intermission_planets[PLANET_RESCUESLAVES].missionCompleted = 1; /// Dialog (Chris Bainfield) /// Used when you rescue enough slaves for the Eyananth slave rescue mission. @@ -792,7 +799,8 @@ void mission_updateRequirements(int type, int id, int value) } else { - sprintf(message, "Rescue %d more...", 250 - game.slavesRescued); + // XXX: Plurals + sprintf(message, _("Rescue %d more..."), 250 - game.slavesRescued); info_setLine(message, FONT_CYAN); } } @@ -800,7 +808,7 @@ void mission_updateRequirements(int type, int id, int value) if ((type == M_DESTROY_TARGET_TYPE) && (id == CD_CLOAKFIGHTER)) { - info_setLine("*** Experimental Fighter Destroyed - Mission Completed ***", FONT_GREEN); + info_setLine(_("*** Experimental Fighter Destroyed - Mission Completed ***"), FONT_GREEN); intermission_planets[PLANET_CLOAKFIGHTER].missionCompleted = 1; /// Dialog (Chris Bainfield) /// Used when the Mordor cloak ship is destroyed. @@ -879,22 +887,22 @@ int mission_checkCompleted() if (mission.remainingObjectives1 > 1) { if ((game.area != MISN_POSWIC) || (i != 1)) - info_setLine("*** Primary Objective Completed ***", FONT_GREEN); + info_setLine(_("*** Primary Objective Completed ***"), FONT_GREEN); else - info_setLine(">>> Primary Objective Failed <<<", FONT_RED); + info_setLine(_(">>> Primary Objective Failed <<<"), FONT_RED); mission.completed1[i] = OB_COMPLETED; } else { if (mission.remainingObjectives2 > 0) { - info_setLine("Emergency warp drive activated. Press button to engage.", FONT_CYAN); + info_setLine(_("Emergency warp drive activated. Press button to engage."), FONT_CYAN); } if (game.area != MISN_INTERCEPTION) - info_setLine("*** All Primary Objectives Completed ***", FONT_GREEN); + info_setLine(_("*** All Primary Objectives Completed ***"), FONT_GREEN); else - info_setLine("*** Interception Destroyed ***", FONT_GREEN); + info_setLine(_("*** Interception Destroyed ***"), FONT_GREEN); mission.completed1[i] = OB_COMPLETED; // do some area specific things @@ -923,12 +931,12 @@ int mission_checkCompleted() { if (mission.remainingObjectives2 > 1) { - info_setLine("*** Secondary Objective Completed ***", FONT_GREEN); + info_setLine(_("*** Secondary Objective Completed ***"), FONT_GREEN); mission.completed2[i] = OB_COMPLETED; } else { - info_setLine("*** All Secondary Objectives Completed ***", FONT_GREEN); + info_setLine(_("*** All Secondary Objectives Completed ***"), FONT_GREEN); mission.completed2[i] = OB_COMPLETED; // do some area specific things @@ -943,13 +951,13 @@ int mission_checkCompleted() if (mission.completed1[i] == OB_JUST_FAILED) { - info_setLine(">>> MISSION FAILED <<<", FONT_RED); + info_setLine(_(">>> MISSION FAILED <<<"), FONT_RED); mission.completed1[i] = OB_FAILED; } if (mission.completed2[i] == OB_JUST_FAILED) { - info_setLine(">>> Secondary Objective Failed <<<", FONT_RED); + info_setLine(_(">>> Secondary Objective Failed <<<"), FONT_RED); mission.completed2[i] = OB_FAILED; } } @@ -1070,20 +1078,21 @@ void mission_showStartScreen() renderer_update(); gfx_loadSprites(); - gfx_createTextObject(TS_SHIELD, "Shield", 0, 0, FONT_WHITE); - gfx_createTextObject(TS_PLASMA_T, "Plasma:", 0, 0, FONT_WHITE); + gfx_createTextObject(TS_SHIELD, _("Shield"), 0, 0, FONT_WHITE); + gfx_createTextObject(TS_PLASMA_T, _("Plasma:"), 0, 0, FONT_WHITE); if (player.weaponType[1] == W_CHARGER) - gfx_createTextObject(TS_AMMO_T, "Charge", 0, 0, FONT_WHITE); + gfx_createTextObject(TS_AMMO_T, _("Charge"), 0, 0, FONT_WHITE); else if (player.weaponType[1] == W_LASER) - gfx_createTextObject(TS_AMMO_T, "Heat", 20, 0, FONT_WHITE); + gfx_createTextObject(TS_AMMO_T, _("Heat"), 20, 0, FONT_WHITE); else - gfx_createTextObject(TS_AMMO_T, "Rockets:", 0, 0, FONT_WHITE); + gfx_createTextObject(TS_AMMO_T, _("Rockets:"), 0, 0, FONT_WHITE); - gfx_createTextObject(TS_TARGET, "Target", 0, 0, FONT_WHITE); - gfx_createTextObject(TS_TARGET_SID, "Sid", 0, 0, FONT_WHITE); - gfx_createTextObject(TS_TARGET_PHOEBE, "Phoebe", 0, 0, FONT_WHITE); - gfx_createTextObject(TS_TARGET_KLINE, "Kline", 0, 0, FONT_WHITE); + gfx_createTextObject(TS_TARGET, _("Target"), 0, 0, FONT_WHITE); + gfx_createTextObject(TS_TARGET_SID, _("Sid"), 0, 0, FONT_WHITE); + gfx_createTextObject(TS_TARGET_PHOEBE, _("Phoebe"), 0, 0, FONT_WHITE); + gfx_createTextObject(TS_TARGET_KLINE, _("Kline"), 0, 0, FONT_WHITE); + // XXX: Bad assumption! Replace with string formatting ASAP! gfx_createTextObject(TS_CASH_T, "Cash: $", 0, 0, FONT_WHITE); gfx_createTextObject(TS_OBJECTIVES_T, "Objectives Remaining:", 0, 0, FONT_WHITE); gfx_createTextObject(TS_TIME_T, "Time Remaining - ", 0, 0, FONT_WHITE); diff --git a/src/shop.c b/src/shop.c index 7833dcc..775984b 100644 --- a/src/shop.c +++ b/src/shop.c @@ -59,7 +59,8 @@ static void drawSecondaryWeaponSurface() switch (player.weaponType[1]) { case W_NONE: - strcpy(description, _("None")); + /// Used to indicate that there is not Secondary Weapon. + strcpy(description, _("Uninstalled")); break; case W_ROCKETS: strcpy(description, _("Rockets"));