From: otta8634 Date: Sun, 15 Sep 2024 15:17:53 +0000 (+0800) Subject: Fix incorrect usage of ftos_decimals, colorset in some transifex strings X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=be6e246993680cb74edbd2c717e51df491156e41;p=xonotic%2Fxonotic-data.pk3dir.git Fix incorrect usage of ftos_decimals, colorset in some transifex strings Thanks again to terencehill for the review --- diff --git a/qcsrc/client/hud/panel/infomessages.qc b/qcsrc/client/hud/panel/infomessages.qc index 12807fb23..c237c6d77 100644 --- a/qcsrc/client/hud/panel/infomessages.qc +++ b/qcsrc/client/hud/panel/infomessages.qc @@ -149,7 +149,7 @@ void HUD_InfoMessages() { //we need to ceil, otherwise the countdown would be off by .5 when using round() float countdown = ceil(STAT(GAMESTARTTIME) - time); - s = strcat(CCR_F4, sprintf(_("Game starts in %s seconds"), strcat(CCR_F2, ftos_decimals(countdown, 0), CCR_F4))); + s = strcat(CCR_F4, sprintf(_("Game starts in %s seconds"), strcat(CCR_F2, ftos(countdown), CCR_F4))); InfoMessage(s); } @@ -171,9 +171,10 @@ void HUD_InfoMessages() if(players_needed > 0) { if(players_needed == 1) - s = sprintf(_("%s more player is needed for the match to start."), strcat(CCR_F2, "1", CCR_F1)); + s = sprintf(_("%s more player is needed for the match to start."), strcat("1", CCR_F1)); else - s = sprintf(_("%s more players are needed for the match to start."), strcat(CCR_F2, ftos_decimals(players_needed, 0), CCR_F1)); + s = sprintf(_("%s more players are needed for the match to start."), strcat(ftos(players_needed), CCR_F1)); + s = strcat(CCR_F2, s); InfoMessage(s); } else if(teamnagger && (ts_max - ts_min) >= teamnagger) @@ -267,8 +268,8 @@ void HUD_InfoMessages() else { InfoMessage(strcat(CCR_BG, sprintf(_("Press %s to show HUD options."), strcat(CCR_F2, "ESC", CCR_BG)))); - InfoMessage(sprintf(_("%s a panel for panel-specific options."), strcat(CCR_F2, "Doubleclick", CCR_BG))); - InfoMessage(sprintf(_("%s to disable collision testing, %s and"), strcat(CCR_F2, "CTRL", CCR_BG), strcat(CCR_F2, "SHIFT", CCR_BG))); - InfoMessage(sprintf(_("%s + %s for fine adjustments."), strcat(CCR_F2, "ALT", CCR_BG), strcat(CCR_F2, "ARROW KEYS", CCR_BG))); + InfoMessage(strcat(CCR_F2, sprintf(_("%s a panel for panel-specific options."), strcat("Doubleclick", CCR_BG)))); + InfoMessage(strcat(CCR_F2, sprintf(_("%s to disable collision testing, %s and"), strcat("CTRL", CCR_BG), strcat(CCR_F2, "SHIFT", CCR_BG)))); + InfoMessage(strcat(CCR_F2, sprintf(_("%s + %s for fine adjustments."), strcat("ALT", CCR_BG), strcat(CCR_F2, "ARROW KEYS", CCR_BG)))); } } diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 1db63558b..ac913fc40 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -2507,7 +2507,7 @@ void Scoreboard_Draw() if (campaign) str = ""; else - str = sprintf(_("%s/%s players"), strcat(CCR_F5, ftos_decimals(numplayers, 0), CCR_BG), strcat(CCR_F5, ftos_decimals((srv_maxplayers ? srv_maxplayers : maxclients), 0), CCR_BG)); + str = sprintf(_("%s/%s players"), strcat(CCR_F5, ftos(numplayers), CCR_BG), strcat(CCR_F5, ftos(srv_maxplayers ? srv_maxplayers : maxclients), CCR_BG)); str = strcat(CCR_BG, _("Map:"), " ", CCR_F1, mi_shortname, " ", str); // reusing "Map:" translatable string drawcolorcodedstring(pos, str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align left } @@ -2675,11 +2675,11 @@ void Scoreboard_Draw() if(race_speedaward) { name = textShortenToWidth(ColorTranslateRGB(race_speedaward_holder), namesize, hud_fontsize, stringwidth_colors); - str = sprintf(_("Speed award: %d%s %s"), race_speedaward * conversion_factor, unit, strcat(CCR_BG, "(", name, CCR_BG, ")")); + str = sprintf(_("Speed award: %s"), strcat(ftos(race_speedaward * conversion_factor), unit, " ", CCR_BG, "(", name, CCR_BG, ")")); str = strcat(CCR_BG, str, " / "); } name = textShortenToWidth(ColorTranslateRGB(race_speedaward_alltimebest_holder), namesize, hud_fontsize, stringwidth_colors); - str = strcat(str, CCR_BG, sprintf(_("All-time fastest: %d%s %s"), race_speedaward_alltimebest * conversion_factor, unit, strcat(CCR_BG, "(", name, CCR_BG, ")"))); + str = strcat(str, CCR_BG, sprintf(_("All-time fastest: %s"), strcat(ftos(race_speedaward_alltimebest * conversion_factor), unit, " ", CCR_BG, "(", name, CCR_BG, ")"))); drawcolorcodedstring(pos, str, hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += 1.25 * hud_fontsize.y; // line height + line spacing } diff --git a/qcsrc/client/hud/panel/vote.qc b/qcsrc/client/hud/panel/vote.qc index a53013fcc..529c8e764 100644 --- a/qcsrc/client/hud/panel/vote.qc +++ b/qcsrc/client/hud/panel/vote.qc @@ -30,7 +30,7 @@ void HUD_Vote() LOG_INFO(_("^1You must answer before entering hud configure mode")); cvar_set("_hud_configure", "0"); } - strcpy(vote_called_vote, strcat(CCR_F1, sprintf(_("Name%s instead of \"%sAnonymous player%s\" in stats"), CCR_BG, CCR_F4, CCR_BG))); + strcpy(vote_called_vote, _("^2Name ^7instead of \"^1Anonymous player^7\" in stats")); uid2name_dialog = 1; }