From 9082ada7a643e2ccb491fc7d1ec13cb55763b476 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 23 Apr 2019 20:18:29 +0200 Subject: [PATCH] Make translatable some remaining minigame messages and 2 radar messages --- qcsrc/client/hud/panel/radar.qc | 4 ++-- qcsrc/common/minigames/cl_minigames_hud.qc | 2 +- qcsrc/common/minigames/minigame/bd.qc | 10 ++++------ qcsrc/common/minigames/minigame/c4.qc | 4 ++-- qcsrc/common/minigames/minigame/nmm.qc | 4 ++-- qcsrc/common/minigames/minigame/pp.qc | 8 ++++---- qcsrc/common/minigames/minigame/ps.qc | 8 ++++---- qcsrc/common/minigames/minigame/ttt.qc | 4 ++-- 8 files changed, 21 insertions(+), 23 deletions(-) diff --git a/qcsrc/client/hud/panel/radar.qc b/qcsrc/client/hud/panel/radar.qc index ca1cb2a06..612dc12e9 100644 --- a/qcsrc/client/hud/panel/radar.qc +++ b/qcsrc/client/hud/panel/radar.qc @@ -370,11 +370,11 @@ void HUD_Radar() if ( hud_panel_radar_mouse ) { - string message = "Click to select teleport destination"; + string message = _("Click to select teleport destination"); if ( STAT(HEALTH) <= 0 ) { - message = "Click to select spawn location"; + message = _("Click to select spawn location"); } drawcolorcodedstring(pos + '0.5 0 0' * (mySize_x - stringwidth(message, true, hud_fontsize)) - '0 1 0' * hud_fontsize_y * 2, diff --git a/qcsrc/common/minigames/cl_minigames_hud.qc b/qcsrc/common/minigames/cl_minigames_hud.qc index 8cfe69c0b..1608f471d 100644 --- a/qcsrc/common/minigames/cl_minigames_hud.qc +++ b/qcsrc/common/minigames/cl_minigames_hud.qc @@ -564,7 +564,7 @@ void HUD_MinigameHelp() help_message = active_minigame.message; } else - help_message = "Minigame message"; + help_message = _("Minigame message"); if ( !help_message ) return; diff --git a/qcsrc/common/minigames/minigame/bd.qc b/qcsrc/common/minigames/minigame/bd.qc index 8ab37af13..16e56e8c5 100644 --- a/qcsrc/common/minigames/minigame/bd.qc +++ b/qcsrc/common/minigames/minigame/bd.qc @@ -1089,22 +1089,20 @@ void bd_hud_board(vector pos, vector mySize) if ( (active_minigame.minigame_flags & BD_TURN_LOSS) || (active_minigame.minigame_flags & BD_TURN_WIN) ) { vector winfs = hud_fontsize*2; - string victory_text = "Game over!"; + string victory_text = _("Game over!"); if(active_minigame.minigame_flags & BD_TURN_WIN) - victory_text = "Well done! Click 'Next Level' to continue"; + victory_text = _("Well done! Click 'Next Level' to continue"); vector win_pos = pos+eY*(mySize_y-winfs_y)/2; vector win_sz; win_sz = minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos, - sprintf("%s", victory_text), - winfs, 0, DRAWFLAG_NORMAL, 0.5); + victory_text, winfs, 0, DRAWFLAG_NORMAL, 0.5); drawfill(win_pos-eY*hud_fontsize_y,win_sz+2*eY*hud_fontsize_y,'0.3 0.3 1',0.8,DRAWFLAG_ADDITIVE); minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos, - sprintf("%s", victory_text), - winfs, panel_fg_alpha, DRAWFLAG_NORMAL, 0.5); + victory_text, winfs, panel_fg_alpha, DRAWFLAG_NORMAL, 0.5); } } diff --git a/qcsrc/common/minigames/minigame/c4.qc b/qcsrc/common/minigames/minigame/c4.qc index c8f8184f5..e29e7a5e9 100644 --- a/qcsrc/common/minigames/minigame/c4.qc +++ b/qcsrc/common/minigames/minigame/c4.qc @@ -308,13 +308,13 @@ void c4_hud_board(vector pos, vector mySize) vector win_pos = pos+eY*(mySize_y-winfs_y)/2; vector win_sz; win_sz = minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos, - sprintf("%s^7 won the game!",pname), + sprintf(_("%s^7 won the game!"), pname), winfs, 0, DRAWFLAG_NORMAL, 0.5); drawfill(win_pos-eY*hud_fontsize_y,win_sz+2*eY*hud_fontsize_y,'1 1 1',0.5,DRAWFLAG_ADDITIVE); minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos, - sprintf("%s^7 won the game!",pname), + sprintf(_("%s^7 won the game!"), pname), winfs, panel_fg_alpha, DRAWFLAG_NORMAL, 0.5); } } diff --git a/qcsrc/common/minigames/minigame/nmm.qc b/qcsrc/common/minigames/minigame/nmm.qc index 65ac9dee0..e1377c6a6 100644 --- a/qcsrc/common/minigames/minigame/nmm.qc +++ b/qcsrc/common/minigames/minigame/nmm.qc @@ -488,13 +488,13 @@ void nmm_hud_board(vector pos, vector mySize) vector win_pos = pos+eY*(mySize_y-winfs_y)/2; vector win_sz; win_sz = minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos, - sprintf("%s^7 won the game!",pname), + sprintf(_("%s^7 won the game!"), pname), winfs, 0, DRAWFLAG_NORMAL, 0.5); drawfill(win_pos-eY*hud_fontsize_y,win_sz+2*eY*hud_fontsize_y,'1 1 1',0.5,DRAWFLAG_ADDITIVE); minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos, - sprintf("%s^7 won the game!",pname), + sprintf(_("%s^7 won the game!"), pname), winfs, panel_fg_alpha, DRAWFLAG_NORMAL, 0.5); } } diff --git a/qcsrc/common/minigames/minigame/pp.qc b/qcsrc/common/minigames/minigame/pp.qc index 0b1d74344..e59318f0d 100644 --- a/qcsrc/common/minigames/minigame/pp.qc +++ b/qcsrc/common/minigames/minigame/pp.qc @@ -359,13 +359,13 @@ void pp_hud_board(vector pos, vector mySize) vector win_pos = pos+eY*(mySize_y-winfs_y)/2; vector win_sz; win_sz = minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos, - sprintf("%s^7 won the game!",pname), + sprintf(_("%s^7 won the game!"), pname), winfs, 0, DRAWFLAG_NORMAL, 0.5); drawfill(win_pos-eY*hud_fontsize_y,win_sz+2*eY*hud_fontsize_y,'1 1 1',0.5,DRAWFLAG_ADDITIVE); minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos, - sprintf("%s^7 won the game!",pname), + sprintf(_("%s^7 won the game!"), pname), winfs, panel_fg_alpha, DRAWFLAG_NORMAL, 0.5); } } @@ -440,8 +440,8 @@ string pp_turn_to_string(int turnflags) if ( turnflags & PP_TURN_WIN ) { if ( (turnflags&PP_TURN_TEAM) != minigame_self.team ) - return _("You lost the game!\nSelect \"^1Next Match^7\" on the menu for a rematch!"); - return _("You win!\nSelect \"^1Next Match^7\" on the menu to start a new match!"); + return strcat(_("You lost the game!"), "\n", _("Select \"^1Next Match^7\" on the menu for a rematch!")); + return strcat(_("You win!"), "\n", _("Select \"^1Next Match^7\" on the menu to start a new match!")); } if ( turnflags & PP_TURN_NEXT ) diff --git a/qcsrc/common/minigames/minigame/ps.qc b/qcsrc/common/minigames/minigame/ps.qc index 6850bd834..540d0a160 100644 --- a/qcsrc/common/minigames/minigame/ps.qc +++ b/qcsrc/common/minigames/minigame/ps.qc @@ -411,20 +411,20 @@ void ps_hud_board(vector pos, vector mySize) vector winfs = hud_fontsize*2; string remaining_text; if(active_minigame.minigame_flags & PS_TURN_WIN) - remaining_text = "All pieces cleared!"; + remaining_text = _("All pieces cleared!"); else - remaining_text = strcat("Remaining pieces: ", ftos(remaining)); + remaining_text = strcat(_("Remaining pieces:"), " ", ftos(remaining)); vector win_pos = pos+eY*(mySize_y-winfs_y)/2; vector win_sz; win_sz = minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos, - sprintf("Game over! %s", remaining_text), + strcat(_("Game over!"), " ", remaining_text), winfs, 0, DRAWFLAG_NORMAL, 0.5); drawfill(win_pos-eY*hud_fontsize_y,win_sz+2*eY*hud_fontsize_y,'1 1 1',0.5,DRAWFLAG_ADDITIVE); minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos, - sprintf("Game over! %s", remaining_text), + strcat(_("Game over!"), " ", remaining_text), winfs, panel_fg_alpha, DRAWFLAG_NORMAL, 0.5); } } diff --git a/qcsrc/common/minigames/minigame/ttt.qc b/qcsrc/common/minigames/minigame/ttt.qc index a6cc50237..7cb4a2f75 100644 --- a/qcsrc/common/minigames/minigame/ttt.qc +++ b/qcsrc/common/minigames/minigame/ttt.qc @@ -321,8 +321,8 @@ string ttt_turn_to_string(int turnflags) if ( turnflags & TTT_TURN_WIN ) { if ( (turnflags&TTT_TURN_TEAM) != minigame_self.team ) - return _("You lost the game!\nSelect \"^1Next Match^7\" on the menu for a rematch!"); - return _("You win!\nSelect \"^1Next Match^7\" on the menu to start a new match!"); + strcat(_("You lost the game!"), "\n", _("Select \"^1Next Match^7\" on the menu for a rematch!")); + return strcat(_("You win!"), "\n", _("Select \"^1Next Match^7\" on the menu to start a new match!")); } if ( turnflags & TTT_TURN_NEXT ) -- 2.39.2