git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] fetch-pack: add TRANSLATORS notice for packfile ready messages
@ 2021-11-14  7:31 Bagas Sanjaya
  2021-11-14  9:50 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 4+ messages in thread
From: Bagas Sanjaya @ 2021-11-14  7:31 UTC (permalink / raw
  To: git
  Cc: Jonathan Tan, Christopher Diaz Riveros, Jean-Noël Avila,
	Daniel Santos, Bagas Sanjaya

Two messages mention "... to be sent after 'ready'". The 'ready' string,
however, is actually in part of packet stream, which shouldn't be
translated. Because of lack of any notices, l10n teams treat it as
ordinary string, which results to inconsistency across teams. That is,
in `po/es.po` the string is translated:

```
msgid "expected packfile to be sent after 'ready'"
msgstr "se esperaba que el packfile fuera enviado luego del 'listo'"

msgid "expected no other sections to be sent after no 'ready'"
msgstr "se esperaba que ninguna otra sección fuera enviada luego del 'listo'"
```

whereas in `po/fr.po` and `po/de.po`, the string isn't translated:

```
msgid "expected packfile to be sent after 'ready'"
msgstr "fichier paquet attendu à envoyer après 'ready'"

msgid "expected no other sections to be sent after no 'ready'"
msgstr "aucune autre section attendue à envoyer après absence de 'ready'"
```

```
msgid "expected packfile to be sent after 'ready'"
msgstr "Erwartete Versand einer Packdatei nach 'ready'."

msgid "expected no other sections to be sent after no 'ready'"
msgstr "Erwartete keinen Versand einer anderen Sektion ohne 'ready'."
```

To avoid confusions, add TRANSLATORS notice.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
---
 fetch-pack.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fetch-pack.c b/fetch-pack.c
index a9604f35a3..0cda8fc518 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -1410,8 +1410,12 @@ static int process_ack(struct fetch_negotiator *negotiator,
 	 * otherwise.
 	 */
 	if (*received_ready && reader->status != PACKET_READ_DELIM)
+		/* TRANSLATORS: 'ready' string is in part of packet stream.
+		   Leave it as is. */
 		die(_("expected packfile to be sent after 'ready'"));
 	if (!*received_ready && reader->status != PACKET_READ_FLUSH)
+		/* TRANSLATORS: 'ready' string is in part of packet stream.
+		   Leave it as is. */
 		die(_("expected no other sections to be sent after no 'ready'"));
 
 	return 0;

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


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

* Re: [PATCH] fetch-pack: add TRANSLATORS notice for packfile ready messages
  2021-11-14  7:31 [PATCH] fetch-pack: add TRANSLATORS notice for packfile ready messages Bagas Sanjaya
@ 2021-11-14  9:50 ` Ævar Arnfjörð Bjarmason
  2021-11-15  5:41   ` Bagas Sanjaya
  0 siblings, 1 reply; 4+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-11-14  9:50 UTC (permalink / raw
  To: Bagas Sanjaya
  Cc: git, Jonathan Tan, Christopher Diaz Riveros, Jean-Noël Avila,
	Daniel Santos


On Sun, Nov 14 2021, Bagas Sanjaya wrote:

> Two messages mention "... to be sent after 'ready'". The 'ready' string,
> however, is actually in part of packet stream, which shouldn't be
> translated. Because of lack of any notices, l10n teams treat it as
> ordinary string, which results to inconsistency across teams. That is,
> in `po/es.po` the string is translated:
>
> ```
> msgid "expected packfile to be sent after 'ready'"
> msgstr "se esperaba que el packfile fuera enviado luego del 'listo'"
>
> msgid "expected no other sections to be sent after no 'ready'"
> msgstr "se esperaba que ninguna otra sección fuera enviada luego del 'listo'"
> ```
>
> whereas in `po/fr.po` and `po/de.po`, the string isn't translated:
>
> ```
> msgid "expected packfile to be sent after 'ready'"
> msgstr "fichier paquet attendu à envoyer après 'ready'"
>
> msgid "expected no other sections to be sent after no 'ready'"
> msgstr "aucune autre section attendue à envoyer après absence de 'ready'"
> ```
>
> ```
> msgid "expected packfile to be sent after 'ready'"
> msgstr "Erwartete Versand einer Packdatei nach 'ready'."
>
> msgid "expected no other sections to be sent after no 'ready'"
> msgstr "Erwartete keinen Versand einer anderen Sektion ohne 'ready'."
> ```
>
> To avoid confusions, add TRANSLATORS notice.

Let's not and:

> Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
> ---
>  fetch-pack.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/fetch-pack.c b/fetch-pack.c
> index a9604f35a3..0cda8fc518 100644
> --- a/fetch-pack.c
> +++ b/fetch-pack.c
> @@ -1410,8 +1410,12 @@ static int process_ack(struct fetch_negotiator *negotiator,
>  	 * otherwise.
>  	 */
>  	if (*received_ready && reader->status != PACKET_READ_DELIM)
> +		/* TRANSLATORS: 'ready' string is in part of packet stream.
> +		   Leave it as is. */
>  		die(_("expected packfile to be sent after 'ready'"));
>  	if (!*received_ready && reader->status != PACKET_READ_FLUSH)
> +		/* TRANSLATORS: 'ready' string is in part of packet stream.
> +		   Leave it as is. */
>
>  		die(_("expected no other sections to be sent after no 'ready'"));

If something isn't meant to be translated do this instead:

    die(_("expected no other sections to be sent after no '%s"), "ready");

I.e. pass it as a parameter.

There can then be a "TRANSLATORS" comment that explains that it's the
string "ready", in reference to that protocol keyword. We do it that way
in various other places, and it completely avoids the potential problem
of a should not be translated string being translated.

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

* Re: [PATCH] fetch-pack: add TRANSLATORS notice for packfile ready messages
  2021-11-14  9:50 ` Ævar Arnfjörð Bjarmason
@ 2021-11-15  5:41   ` Bagas Sanjaya
  2021-11-15 15:21     ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 4+ messages in thread
From: Bagas Sanjaya @ 2021-11-15  5:41 UTC (permalink / raw
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Jonathan Tan, Christopher Diaz Riveros, Jean-Noël Avila,
	Daniel Santos

On 14/11/21 16.50, Ævar Arnfjörð Bjarmason wrote:
> If something isn't meant to be translated do this instead:
> 
>      die(_("expected no other sections to be sent after no '%s"), "ready");
> 
> I.e. pass it as a parameter.
> 
> There can then be a "TRANSLATORS" comment that explains that it's the
> string "ready", in reference to that protocol keyword. We do it that way
> in various other places, and it completely avoids the potential problem
> of a should not be translated string being translated.
> 

Something like:
/* TRANSLATORS: The 'ready' string is the protocol keyword. Leave it
    as is. */ ?

But I have admitted that I lean to your suggestion.

-- 
An old man doll... just what I always wanted! - Clara

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

* Re: [PATCH] fetch-pack: add TRANSLATORS notice for packfile ready messages
  2021-11-15  5:41   ` Bagas Sanjaya
@ 2021-11-15 15:21     ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 4+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-11-15 15:21 UTC (permalink / raw
  To: Bagas Sanjaya
  Cc: git, Jonathan Tan, Christopher Diaz Riveros, Jean-Noël Avila,
	Daniel Santos


On Mon, Nov 15 2021, Bagas Sanjaya wrote:

> On 14/11/21 16.50, Ævar Arnfjörð Bjarmason wrote:
>> If something isn't meant to be translated do this instead:
>>      die(_("expected no other sections to be sent after no '%s"),
>> "ready");
>> I.e. pass it as a parameter.
>> There can then be a "TRANSLATORS" comment that explains that it's
>> the
>> string "ready", in reference to that protocol keyword. We do it that way
>> in various other places, and it completely avoids the potential problem
>> of a should not be translated string being translated.
>> 
>
> Something like:
> /* TRANSLATORS: The 'ready' string is the protocol keyword. Leave it
>    as is. */ ?

No, e.g. "TRANSLATORS: The parameter will be 'ready', a protocol
keyword" or something.

I.e. you don't need to instruct them to leave it as-is if there's no way
they can't leave it as-is, since it's being passed as a parameter.

> But I have admitted that I lean to your suggestion.

Yes you could also embed it in the string, but why do that in this case?
Seems like zero benefit, and potential translator confusion.

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

end of thread, other threads:[~2021-11-15 15:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-14  7:31 [PATCH] fetch-pack: add TRANSLATORS notice for packfile ready messages Bagas Sanjaya
2021-11-14  9:50 ` Ævar Arnfjörð Bjarmason
2021-11-15  5:41   ` Bagas Sanjaya
2021-11-15 15:21     ` Ævar Arnfjörð Bjarmason

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).