From 53f0542dc70b9dc40b7f22cc16a1f98af2a74de8 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 8 Aug 2024 17:52:18 +0200 Subject: [PATCH] Remove trailing space and " %s^BG" used for connecting different sentences from translatable messages --- qcsrc/common/notifications/all.inc | 2 +- qcsrc/common/notifications/all.qh | 50 ++++++++++++++++-------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index 4e363d55e..89a4dbfbb 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -721,7 +721,7 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input != MSG_CENTER_NOTIF(ITEM_WEAPON_DROP, N_ENABLE, 0, 2, "item_wepname item_wepammo", CPID_ITEM, "item_centime 0", _("^BGYou dropped the ^F1%s^BG%s"), "") MSG_CENTER_NOTIF(ITEM_WEAPON_GOT, N_ENABLE, 0, 1, "item_wepname", CPID_ITEM, "item_centime 0", _("^BGYou got the ^F1%s"), "") MSG_CENTER_NOTIF(ITEM_WEAPON_NOAMMO, N_ENABLE, 0, 1, "item_wepname", CPID_ITEM, "item_centime 0", _("^BGYou don't have enough ammo for the ^F1%s"), "") - MSG_CENTER_NOTIF(ITEM_WEAPON_PRIMORSEC, N_ENABLE, 0, 3, "item_wepname f2primsec f3primsec", CPID_ITEM, "item_centime 0", _("^F1%s %s^BG is unable to fire, but its ^F1%s^BG can"), "") + MSG_CENTER_NOTIF(ITEM_WEAPON_PRIMORSEC, N_ENABLE, 0, 3, "item_wepname f2primsec f3primsec", CPID_ITEM, "item_centime 0", _("^F1%s %s^BG is unable to fire, but its ^F1%s^BG can"), "") // example for translators: Electro primary is unable to fire, but its secondary can MSG_CENTER_NOTIF(ITEM_WEAPON_UNAVAILABLE, N_ENABLE, 0, 1, "item_wepname", CPID_ITEM, "item_centime 0", _("^F1%s^BG is ^F4not available^BG on this map"), "") MSG_CENTER_NOTIF(JOIN_PREVENT_VERSIONMISMATCH, N_ENABLE, 0, 0, "", CPID_PREVENT_JOIN, "0 0", _("^K1Your Xonotic version is incompatible with the server's version!"), "") diff --git a/qcsrc/common/notifications/all.qh b/qcsrc/common/notifications/all.qh index e7e26a48e..461253fa6 100644 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@ -465,13 +465,13 @@ MACRO_END #define NOTIF_HIT_UNKNOWN(token,funcname) { backtrace(sprintf("%s: Hit unknown token in selected string! '%s'\n", funcname, selected)); break; } #define KILL_SPREE_LIST \ - SPREE_ITEM(3, 03, _("TRIPLE FRAG! "), _("%s^K1 made a TRIPLE FRAG! %s^BG"), _("%s^K1 made a TRIPLE SCORE! %s^BG")) \ - SPREE_ITEM(5, 05, _("RAGE! "), _("%s^K1 unlocked RAGE! %s^BG"), _("%s^K1 made FIVE SCORES IN A ROW! %s^BG")) \ - SPREE_ITEM(10, 10, _("MASSACRE! "), _("%s^K1 started a MASSACRE! %s^BG"), _("%s^K1 made TEN SCORES IN A ROW! %s^BG")) \ - SPREE_ITEM(15, 15, _("MAYHEM! "), _("%s^K1 executed MAYHEM! %s^BG"), _("%s^K1 made FIFTEEN SCORES IN A ROW! %s^BG")) \ - SPREE_ITEM(20, 20, _("BERSERKER! "), _("%s^K1 is a BERSERKER! %s^BG"), _("%s^K1 made TWENTY SCORES IN A ROW! %s^BG")) \ - SPREE_ITEM(25, 25, _("CARNAGE! "), _("%s^K1 inflicts CARNAGE! %s^BG"), _("%s^K1 made TWENTY FIVE SCORES IN A ROW! %s^BG")) \ - SPREE_ITEM(30, 30, _("ARMAGEDDON! "), _("%s^K1 unleashes ARMAGEDDON! %s^BG"), _("%s^K1 made THIRTY SCORES IN A ROW! %s^BG")) + SPREE_ITEM(3, 03, _("TRIPLE FRAG!"), _("%s^K1 made a TRIPLE FRAG!"), _("%s^K1 made a TRIPLE SCORE!")) \ + SPREE_ITEM(5, 05, _("RAGE!"), _("%s^K1 unlocked RAGE!"), _("%s^K1 made FIVE SCORES IN A ROW!")) \ + SPREE_ITEM(10, 10, _("MASSACRE!"), _("%s^K1 started a MASSACRE!"), _("%s^K1 made TEN SCORES IN A ROW!")) \ + SPREE_ITEM(15, 15, _("MAYHEM!"), _("%s^K1 executed MAYHEM!"), _("%s^K1 made FIFTEEN SCORES IN A ROW!")) \ + SPREE_ITEM(20, 20, _("BERSERKER!"), _("%s^K1 is a BERSERKER!"), _("%s^K1 made TWENTY SCORES IN A ROW!")) \ + SPREE_ITEM(25, 25, _("CARNAGE!"), _("%s^K1 inflicts CARNAGE!"), _("%s^K1 made TWENTY FIVE SCORES IN A ROW!")) \ + SPREE_ITEM(30, 30, _("ARMAGEDDON!"), _("%s^K1 unleashes ARMAGEDDON!"), _("%s^K1 made THIRTY SCORES IN A ROW!")) #ifdef CSQC string notif_arg_frag_ping(bool newline, float fping) @@ -510,7 +510,8 @@ string notif_arg_spree_cen(float spree) if(spree > 1) { #define SPREE_ITEM(counta,countb,center,normal,gentle) \ - case counta: { return normal_or_gentle(center, sprintf(_("%d score spree! "), spree)); } + case counta: \ + return strcat(normal_or_gentle(center, sprintf(_("%d score spree!"), spree)), " "); switch(spree) { @@ -521,10 +522,10 @@ string notif_arg_spree_cen(float spree) { return sprintf( - normal_or_gentle( - _("%d frag spree! "), - _("%d score spree! ") - ), + strcat(normal_or_gentle( + _("%d frag spree!"), + _("%d score spree!") + ), " "), spree); } else { return ""; } // don't show spree information if it isn't an achievement @@ -535,11 +536,11 @@ string notif_arg_spree_cen(float spree) } else if(spree == -1) // first blood { - return normal_or_gentle(_("First blood! "), _("First score! ")); + return strcat(normal_or_gentle(_("First blood!"), _("First score!")), " "); } else if(spree == -2) // first victim { - return normal_or_gentle(_("First victim! "), _("First casualty! ")); + return strcat(normal_or_gentle(_("First victim!"), _("First casualty!")), " "); } } return ""; @@ -568,7 +569,9 @@ string notif_arg_spree_inf(float type, string input, string player, float spree) if(spree > 1) { #define SPREE_ITEM(counta,countb,center,normal,gentle) \ - case counta: { return sprintf(CCR(normal_or_gentle(normal, gentle)), player, spree_newline); } + case counta: \ + return sprintf(CCR(strcat(normal_or_gentle(normal, gentle), " %s^BG")), \ + player, spree_newline); switch(spree) { @@ -579,10 +582,10 @@ string notif_arg_spree_inf(float type, string input, string player, float spree) { return sprintf( - CCR(normal_or_gentle( - _("%s^K1 has %d frags in a row! %s^BG"), - _("%s^K1 made %d scores in a row! %s^BG") - )), + CCR(strcat(normal_or_gentle( + _("%s^K1 has %d frags in a row!"), + _("%s^K1 made %d scores in a row!") + ), " %s^BG")), player, spree, spree_newline @@ -598,10 +601,10 @@ string notif_arg_spree_inf(float type, string input, string player, float spree) { return sprintf( - CCR(normal_or_gentle( - _("%s^K1 drew first blood! %s^BG"), - _("%s^K1 got the first score! %s^BG") - )), + CCR(strcat(normal_or_gentle( + _("%s^K1 drew first blood!"), + _("%s^K1 got the first score!") + ), " %s^BG")), player, spree_newline ); @@ -658,6 +661,7 @@ string notif_arg_item_wepammo(float f1, float f2) case RES_FUEL: ammotype = ITEM_JetpackFuel.m_name; break; default: return ""; // doesn't use ammo } + // example for translators: You dropped the Vortex with 5 cells return sprintf(_(" with %d %s"), f2, strtolower(ammotype)); } -- 2.39.2