git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v3] fetch-pack: parameterize message containing 'ready' keyword
@ 2021-11-22 12:34 Bagas Sanjaya
  2021-11-22 13:02 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 3+ messages in thread
From: Bagas Sanjaya @ 2021-11-22 12:34 UTC (permalink / raw)
  To: git
  Cc: Eric Sunshine, Jonathan Tan,
	Ævar Arnfjörð Bjarmason, 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).

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
---
 Changes since v2 [1]:
   - Add missing closing single quote after the parameter (suggested by
     Eric)
   - Remove stray 'no' at the second message (suggested by Ævar)

 [1]:
https://lore.kernel.org/git/20211118103424.6464-1-bagasdotme@gmail.com/T/#u

 fetch-pack.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fetch-pack.c b/fetch-pack.c
index a9604f35a3..62d6313708 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -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 '%s'"), "ready");
 
 	return 0;
 }

base-commit: cd3e606211bb1cf8bc57f7d76bab98cc17a150bc
-- 
An old man doll... just what I always wanted! - Clara


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] fetch-pack: parameterize message containing 'ready' keyword
  2021-11-22 12:34 [PATCH v3] fetch-pack: parameterize message containing 'ready' keyword Bagas Sanjaya
@ 2021-11-22 13:02 ` Ævar Arnfjörð Bjarmason
  2021-11-22 17:35   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-11-22 13:02 UTC (permalink / raw)
  To: Bagas Sanjaya; +Cc: git, Eric Sunshine, Jonathan Tan


On Mon, Nov 22 2021, Bagas Sanjaya wrote:

> The protocol keyword 'ready' isn't meant for translation. Pass it as
> parameter instead of spell it in die() message (and potentially confuse
> translators).
>
> Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
> ---
>  Changes since v2 [1]:
>    - Add missing closing single quote after the parameter (suggested by
>      Eric)
>    - Remove stray 'no' at the second message (suggested by Ævar)
>
>  [1]:
> https://lore.kernel.org/git/20211118103424.6464-1-bagasdotme@gmail.com/T/#u
>
>  fetch-pack.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/fetch-pack.c b/fetch-pack.c
> index a9604f35a3..62d6313708 100644
> --- a/fetch-pack.c
> +++ b/fetch-pack.c
> @@ -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 '%s'"), "ready");
>  
>  	return 0;
>  }
>
> base-commit: cd3e606211bb1cf8bc57f7d76bab98cc17a150bc

This looks good to me & ready to go. Thanks for sticking with this
across various nits/small isues for all 3x iterations.

The TRANSLATORS comments being added here don't use our usual style, but
I'd be happy just to leave this be & take it as-is without a re-roll,
don't know about Junio...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] fetch-pack: parameterize message containing 'ready' keyword
  2021-11-22 13:02 ` Ævar Arnfjörð Bjarmason
@ 2021-11-22 17:35   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2021-11-22 17:35 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Bagas Sanjaya, git, Eric Sunshine, Jonathan Tan

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> On Mon, Nov 22 2021, Bagas Sanjaya wrote:
>
>> The protocol keyword 'ready' isn't meant for translation. Pass it as
>> parameter instead of spell it in die() message (and potentially confuse
>> translators).
>>
>> Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
>> ---
>>  Changes since v2 [1]:
>>    - Add missing closing single quote after the parameter (suggested by
>>      Eric)
>>    - Remove stray 'no' at the second message (suggested by Ævar)
>>
>>  [1]:
>> https://lore.kernel.org/git/20211118103424.6464-1-bagasdotme@gmail.com/T/#u
>>
>>  fetch-pack.c | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/fetch-pack.c b/fetch-pack.c
>> index a9604f35a3..62d6313708 100644
>> --- a/fetch-pack.c
>> +++ b/fetch-pack.c
>> @@ -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 '%s'"), "ready");
>>  
>>  	return 0;
>>  }
>>
>> base-commit: cd3e606211bb1cf8bc57f7d76bab98cc17a150bc
>
> This looks good to me & ready to go. Thanks for sticking with this
> across various nits/small isues for all 3x iterations.
>
> The TRANSLATORS comments being added here don't use our usual style, but
> I'd be happy just to leave this be & take it as-is without a re-roll,
> don't know about Junio...

I think in ancient time gettext suite required "/* TRANSLATORS:" at
the beginning, which made us deliberately violate our usual
multi-line comment style convention, but it seems that is no longer
the case?  Hits from "git grep -e '[  ]\* TRANSLATORS \*.c" are
fairly common, it seems.

So, yes, it would be better to fix these comments up, to avoid
misleading people into thinking that the old comment-style exception
still applies.

Thanks, both, for working on this.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-22 17:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22 12:34 [PATCH v3] fetch-pack: parameterize message containing 'ready' keyword Bagas Sanjaya
2021-11-22 13:02 ` Ævar Arnfjörð Bjarmason
2021-11-22 17:35   ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).