Skip to contentSkip to conversation

fetch-pack: parameterize message containing 'ready' keyword

PATCH Superseded Bagas Sanjaya 3 participants 3 messages Nov 18, 2021

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 fetch-pack: parameterize message containing 'ready' keyword

The protocol keyword 'ready' isn't meant for translation. Pass it as parameter instead of spell it in die() message (and potentially confuse translators).

---
Changes since v1 [1]:
- Parameterize message (suggested by Ævar)

[1]:
https://lore.kernel.org/git/[email protected]/T/#u

 fetch-pack.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
fetch-pack.c +6 -2
index a9604f35a3..b8a20778bb 100644
@@ -1410,9 +1410,13 @@ static int process_ack(struct fetch_negotiator *negotiator,
 	 * otherwise.
 	 */
 	if (*received_ready && reader->status != PACKET_READ_DELIM)
-		die(_("expected packfile to be sent after 'ready'"));
+		/* TRANSLATORS: The parameter will be 'ready', a protocol
+		 * keyword */
+		die(_("expected packfile to be sent after '%s"), "ready");
 	if (!*received_ready && reader->status != PACKET_READ_FLUSH)
-		die(_("expected no other sections to be sent after no 'ready'"));
+		/* TRANSLATORS: The parameter will be 'ready', a protocol
+		 * keyword */
+		die(_("expected no other sections to be sent after no '%s"), "ready");
 
 	return 0;
 }

base-commit: cd3e606211bb1cf8bc57f7d76bab98cc17a150bc

Signature · 1 line
An old man doll... just what I always wanted! - Clara
#1 lore raw

fetch-pack.c static int process_ack(struct fetch_negotiator *negotiator, · line 1413

Quoted 13 lines · Bagas Sanjaya

The protocol keyword 'ready' isn't meant for translation. Pass it as parameter instead of spell it in die() message (and potentially confuse translators).

---

fetch-pack.c +3 -1
@@ -1410,9 +1410,13 @@ static int process_ack(struct fetch_negotiator *negotiator,
        if (*received_ready && reader->status != PACKET_READ_DELIM)
-               die(_("expected packfile to be sent after 'ready'"));
+               /* TRANSLATORS: The parameter will be 'ready', a protocol
+                * keyword */
+               die(_("expected packfile to be sent after '%s"), "ready");

Missing closing single-quote after %s.

fetch-pack.c static int process_ack(struct fetch_negotiator *negotiator, · line 1419

Quoted 5 lines
fetch-pack.c +3 -1
        if (!*received_ready && reader->status != PACKET_READ_FLUSH)
-               die(_("expected no other sections to be sent after no 'ready'"));
+               /* TRANSLATORS: The parameter will be 'ready', a protocol
+                * keyword */
+               die(_("expected no other sections to be sent after no '%s"), "ready");

Missing closing single-quote after %s.

Quoted 2 lines
fetch-pack.c +0 -0
        return 0;
 }
#2 lore raw
Quoted 17 lines · Eric Sunshine

fetch-pack.c static int process_ack(struct fetch_negotiator *negotiator, · line 1413

Quoted 13 lines · Bagas Sanjaya

The protocol keyword 'ready' isn't meant for translation. Pass it as parameter instead of spell it in die() message (and potentially confuse translators).

---

fetch-pack.c +3 -1
@@ -1410,9 +1410,13 @@ static int process_ack(struct fetch_negotiator *negotiator,
        if (*received_ready && reader->status != PACKET_READ_DELIM)
-               die(_("expected packfile to be sent after 'ready'"));
+               /* TRANSLATORS: The parameter will be 'ready', a protocol
+                * keyword */
+               die(_("expected packfile to be sent after '%s"), "ready");

Missing closing single-quote after %s.

Quoted 7 lines

fetch-pack.c static int process_ack(struct fetch_negotiator *negotiator, · line 1419

Quoted 5 lines
fetch-pack.c +3 -1
        if (!*received_ready && reader->status != PACKET_READ_FLUSH)
-               die(_("expected no other sections to be sent after no 'ready'"));
+               /* TRANSLATORS: The parameter will be 'ready', a protocol
+                * keyword */
+               die(_("expected no other sections to be sent after no '%s"), "ready");

Missing closing single-quote after %s.

Also s/be sent after no/be sent after/, i.e. there's a stray "no".