threads / patch / 36003

patchi18n: proposed command missing leading dash

Subject: [PATCH] i18n: proposed command missing leading dash

## tl;dr

11 messages between Feb 28, 2014 and Mar 11, 2014. Diffs are folded; open one to read it.

replies: 10people: 5as markdown or json

Sandy Carter· Feb 28, 2014, 20:52 UTC · lore

Add missing leading dash to proposed commands in french output when using the command: git branch --set-upstream remotename/branchname

Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
---
 po/fr.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to po/fr.po +1 −1
diff --git a/po/fr.po b/po/fr.po
index e10263f..7b44229 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -3266,7 +3266,7 @@ msgstr "    git branch -d %s\n"
 #: builtin/branch.c:1027
 #, c-format
 msgid "    git branch --set-upstream-to %s\n"
-msgstr "    git branch -set-upstream-to %s\n"
+msgstr "    git branch --set-upstream-to %s\n"
 
 #: builtin/bundle.c:47
 #, c-format
-- 
1.9.0
Jonathan Nieder· Feb 28, 2014, 21:41 UTC · re: Sandy Carter · lore

Re: [PATCH] i18n: proposed command missing leading dash

Hi,
Sandy Carter wrote:
> Add missing leading dash to proposed commands in french output when
> using the command:
Thanks!
[...]
Show 8 quoted lines
> --- a/po/fr.po
> +++ b/po/fr.po
> @@ -3266,7 +3266,7 @@ msgstr "    git branch -d %s\n"
>  #: builtin/branch.c:1027
>  #, c-format
>  msgid "    git branch --set-upstream-to %s\n"
> -msgstr "    git branch -set-upstream-to %s\n"
> +msgstr "    git branch --set-upstream-to %s\n"

To make life saner for translators, this should be either untranslatable or a single multi-line string, I suspect:

Show changes to diff +6 −4
diff --git i/builtin/branch.c w/builtin/branch.c
index b4d7716..972040c 100644
--- i/builtin/branch.c
+++ w/builtin/branch.c
@@ -1022,11 +1022,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 		 */
 		if (argc == 1 && track == BRANCH_TRACK_OVERRIDE &&
 		    !branch_existed && remote_tracking) {
-			fprintf(stderr, _("\nIf you wanted to make '%s' track '%s', do this:\n\n"), head, branch->name);
-			fprintf(stderr, _("    git branch -d %s\n"), branch->name);
-			fprintf(stderr, _("    git branch --set-upstream-to %s\n"), branch->name);
+			fprintf(stderr, "\n");
+			fprintf(stderr, _("If you wanted to make '%s' track '%s', do this:\n\n"
+					  "    git branch -d %s\n"
+					  "    git branch --set-upstream-to %s"),
+					head, branch->name, branch->name, branch->name);
+			fprintf(stderr, "\n");
 		}
-
 	} else
 		usage_with_options(builtin_branch_usage, options);
 
What do you think?

Jonathan
Junio C Hamano· Feb 28, 2014, 23:31 UTC · re: Jonathan Nieder · lore

Re: [PATCH] i18n: proposed command missing leading dash

Jonathan Nieder <jrnieder@gmail.com> writes:
Show 26 quoted lines
> To make life saner for translators, this should be either
> untranslatable or a single multi-line string, I suspect:
>
> diff --git i/builtin/branch.c w/builtin/branch.c
> index b4d7716..972040c 100644
> --- i/builtin/branch.c
> +++ w/builtin/branch.c
> @@ -1022,11 +1022,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
>  		 */
>  		if (argc == 1 && track == BRANCH_TRACK_OVERRIDE &&
>  		    !branch_existed && remote_tracking) {
> -			fprintf(stderr, _("\nIf you wanted to make '%s' track '%s', do this:\n\n"), head, branch->name);
> -			fprintf(stderr, _("    git branch -d %s\n"), branch->name);
> -			fprintf(stderr, _("    git branch --set-upstream-to %s\n"), branch->name);
> +			fprintf(stderr, "\n");
> +			fprintf(stderr, _("If you wanted to make '%s' track '%s', do this:\n\n"
> +					  "    git branch -d %s\n"
> +					  "    git branch --set-upstream-to %s"),
> +					head, branch->name, branch->name, branch->name);
> +			fprintf(stderr, "\n");
>  		}
> -
>  	} else
>  		usage_with_options(builtin_branch_usage, options);
>  
> What do you think?

Yes, I think it is sensible to make sure that the command examples are not corrupted by the _() process.

Sandy Carter· Mar 1, 2014, 00:36 UTC · re: Junio C Hamano · lore

Re: [PATCH] i18n: proposed command missing leading dash

Should I also update the relevant git.pot and *.po sections?
----- Original Message -----
From: "Junio C Hamano" <gitster@pobox.com>
To: "Jonathan Nieder" <jrnieder@gmail.com>
Cc: "Sandy Carter" <sandy.carter@savoirfairelinux.com>, git@vger.kernel.org, "jn avila" <jn.avila@free.fr>, "Carlos Martín Nieto" <cmn@elego.de>
Sent: Friday, February 28, 2014 6:31:32 PM
Subject: Re: [PATCH] i18n: proposed command missing leading dash
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 26 quoted lines
> To make life saner for translators, this should be either
> untranslatable or a single multi-line string, I suspect:
>
> diff --git i/builtin/branch.c w/builtin/branch.c
> index b4d7716..972040c 100644
> --- i/builtin/branch.c
> +++ w/builtin/branch.c
> @@ -1022,11 +1022,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
>  		 */
>  		if (argc == 1 && track == BRANCH_TRACK_OVERRIDE &&
>  		    !branch_existed && remote_tracking) {
> -			fprintf(stderr, _("\nIf you wanted to make '%s' track '%s', do this:\n\n"), head, branch->name);
> -			fprintf(stderr, _("    git branch -d %s\n"), branch->name);
> -			fprintf(stderr, _("    git branch --set-upstream-to %s\n"), branch->name);
> +			fprintf(stderr, "\n");
> +			fprintf(stderr, _("If you wanted to make '%s' track '%s', do this:\n\n"
> +					  "    git branch -d %s\n"
> +					  "    git branch --set-upstream-to %s"),
> +					head, branch->name, branch->name, branch->name);
> +			fprintf(stderr, "\n");
>  		}
> -
>  	} else
>  		usage_with_options(builtin_branch_usage, options);
>  
> What do you think?

Yes, I think it is sensible to make sure that the command examples are not corrupted by the _() process.

Sandy Carter· Mar 3, 2014, 14:55 UTC · re: Sandy Carter · lore

[PATCH v2 1/2] i18n: proposed command missing leading dash

Add missing leading dash to proposed commands in french output when
using the command:
    git branch --set-upstream remotename/branchname
and when upstream is gone
Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
---
 po/fr.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to po/fr.po +2 −2
diff --git a/po/fr.po b/po/fr.po
index e10263f..0b9d59e 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -1075,7 +1075,7 @@ msgstr "Votre branche est basée sur '%s', mais la branche amont a disparu.\n"
 
 #: remote.c:1875
 msgid "  (use \"git branch --unset-upstream\" to fixup)\n"
-msgstr "  (utilisez \"git branch -unset-upstream\" pour corriger)\n"
+msgstr "  (utilisez \"git branch --unset-upstream\" pour corriger)\n"
 
 #: remote.c:1878
 #, c-format
@@ -3266,7 +3266,7 @@ msgstr "    git branch -d %s\n"
 #: builtin/branch.c:1027
 #, c-format
 msgid "    git branch --set-upstream-to %s\n"
-msgstr "    git branch -set-upstream-to %s\n"
+msgstr "    git branch --set-upstream-to %s\n"
 
 #: builtin/bundle.c:47
 #, c-format
-- 
1.9.0
Sandy Carter· Mar 3, 2014, 14:55 UTC · re: Sandy Carter · lore

[PATCH v2 2/2] i18n: assure command not corrupted by _() process

Separate message from command examples to avoid translation issues such as a dash being omitted in a translation.

Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
---
 builtin/branch.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Show changes to builtin/branch.c +6 −4
diff --git a/builtin/branch.c b/builtin/branch.c
index b4d7716..b304da8 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -1022,11 +1022,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 		 */
 		if (argc == 1 && track == BRANCH_TRACK_OVERRIDE &&
 		    !branch_existed && remote_tracking) {
-			fprintf(stderr, _("\nIf you wanted to make '%s' track '%s', do this:\n\n"), head, branch->name);
-			fprintf(stderr, _("    git branch -d %s\n"), branch->name);
-			fprintf(stderr, _("    git branch --set-upstream-to %s\n"), branch->name);
+			fprintf(stderr, "\n");
+			fprintf(stderr, _("If you wanted to make '%s' track '%s', do this:"), head, branch->name);
+			fprintf(stderr, "\n\n");
+			fprintf(stderr, "    git branch -d %s\n", branch->name);
+			fprintf(stderr, "    git branch --set-upstream-to %s\n", branch->name);
+			fprintf(stderr, "\n");
 		}
-
 	} else
 		usage_with_options(builtin_branch_usage, options);
 
-- 
1.9.0
Sandy Carter· Mar 10, 2014, 12:51 UTC · re: Sandy Carter · lore

Re: [PATCH v2 2/2] i18n: assure command not corrupted by _() process

Is there any update on this patch?
Le 2014-03-03 09:55, Sandy Carter a écrit :
Show 31 quoted lines
> Separate message from command examples to avoid translation issues
> such as a dash being omitted in a translation.
>
> Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
> ---
>   builtin/branch.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/builtin/branch.c b/builtin/branch.c
> index b4d7716..b304da8 100644
> --- a/builtin/branch.c
> +++ b/builtin/branch.c
> @@ -1022,11 +1022,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
>   		 */
>   		if (argc == 1 && track == BRANCH_TRACK_OVERRIDE &&
>   		    !branch_existed && remote_tracking) {
> -			fprintf(stderr, _("\nIf you wanted to make '%s' track '%s', do this:\n\n"), head, branch->name);
> -			fprintf(stderr, _("    git branch -d %s\n"), branch->name);
> -			fprintf(stderr, _("    git branch --set-upstream-to %s\n"), branch->name);
> +			fprintf(stderr, "\n");
> +			fprintf(stderr, _("If you wanted to make '%s' track '%s', do this:"), head, branch->name);
> +			fprintf(stderr, "\n\n");
> +			fprintf(stderr, "    git branch -d %s\n", branch->name);
> +			fprintf(stderr, "    git branch --set-upstream-to %s\n", branch->name);
> +			fprintf(stderr, "\n");
>   		}
> -
>   	} else
>   		usage_with_options(builtin_branch_usage, options);
>
>
Duy Nguyen· Mar 11, 2014, 11:40 UTC · re: Sandy Carter · lore

Re: [PATCH v2 2/2] i18n: assure command not corrupted by _() process

On Mon, Mar 10, 2014 at 7:51 PM, Sandy Carter <sandy.carter@savoirfairelinux.com> wrote:

> Is there any update on this patch?
The patch looks good. Maybe Junio missed it.
Show 45 quoted lines
>
> Le 2014-03-03 09:55, Sandy Carter a écrit :
>
>> Separate message from command examples to avoid translation issues
>> such as a dash being omitted in a translation.
>>
>> Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
>> ---
>>   builtin/branch.c | 10 ++++++----
>>   1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/builtin/branch.c b/builtin/branch.c
>> index b4d7716..b304da8 100644
>> --- a/builtin/branch.c
>> +++ b/builtin/branch.c
>> @@ -1022,11 +1022,13 @@ int cmd_branch(int argc, const char **argv, const
>> char *prefix)
>>                  */
>>                 if (argc == 1 && track == BRANCH_TRACK_OVERRIDE &&
>>                     !branch_existed && remote_tracking) {
>> -                       fprintf(stderr, _("\nIf you wanted to make '%s'
>> track '%s', do this:\n\n"), head, branch->name);
>> -                       fprintf(stderr, _("    git branch -d %s\n"),
>> branch->name);
>> -                       fprintf(stderr, _("    git branch
>> --set-upstream-to %s\n"), branch->name);
>> +                       fprintf(stderr, "\n");
>> +                       fprintf(stderr, _("If you wanted to make '%s'
>> track '%s', do this:"), head, branch->name);
>> +                       fprintf(stderr, "\n\n");
>> +                       fprintf(stderr, "    git branch -d %s\n",
>> branch->name);
>> +                       fprintf(stderr, "    git branch --set-upstream-to
>> %s\n", branch->name);
>> +                       fprintf(stderr, "\n");
>>                 }
>> -
>>         } else
>>                 usage_with_options(builtin_branch_usage, options);
>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Duy
Junio C Hamano· Mar 4, 2014, 18:40 UTC · re: Sandy Carter · lore

Re: [PATCH v2 1/2] i18n: proposed command missing leading dash

From: Sandy Carter <sandy.carter@savoirfairelinux.com>
Date: Mon,  3 Mar 2014 09:55:53 -0500
Add missing leading dash to proposed commands in french output when
using the command:
    git branch --set-upstream remotename/branchname
and when upstream is gone
Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * Forwarding to the i18n coordinator.  I don't do French, but this
   seems trivially correct.
 po/fr.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to po/fr.po +2 −2
diff --git a/po/fr.po b/po/fr.po
index e10263f..0b9d59e 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -1075,7 +1075,7 @@ msgstr "Votre branche est basée sur '%s', mais la branche amont a disparu.\n"
 
 #: remote.c:1875
 msgid "  (use \"git branch --unset-upstream\" to fixup)\n"
-msgstr "  (utilisez \"git branch -unset-upstream\" pour corriger)\n"
+msgstr "  (utilisez \"git branch --unset-upstream\" pour corriger)\n"
 
 #: remote.c:1878
 #, c-format
@@ -3266,7 +3266,7 @@ msgstr "    git branch -d %s\n"
 #: builtin/branch.c:1027
 #, c-format
 msgid "    git branch --set-upstream-to %s\n"
-msgstr "    git branch -set-upstream-to %s\n"
+msgstr "    git branch --set-upstream-to %s\n"
 
 #: builtin/bundle.c:47
 #, c-format
-- 
1.9.0
Jiang Xin· Mar 5, 2014, 14:14 UTC · re: Junio C Hamano · lore

Re: [PATCH v2 1/2] i18n: proposed command missing leading dash

2014-03-05 2:40 GMT+08:00 Junio C Hamano <gitster@pobox.com>:
Show 14 quoted lines
> From: Sandy Carter <sandy.carter@savoirfairelinux.com>
> Date: Mon,  3 Mar 2014 09:55:53 -0500
>
> Add missing leading dash to proposed commands in french output when
> using the command:
>     git branch --set-upstream remotename/branchname
> and when upstream is gone
>
> Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>
>  * Forwarding to the i18n coordinator.  I don't do French, but this
>    seems trivially correct.

Applied to maint branch of git://github.com/git-l10n/git-po, and can be merged to master directly.

-- 
Jiang Xin
Junio C Hamano· Mar 5, 2014, 21:57 UTC · re: Jiang Xin · lore

Re: [PATCH v2 1/2] i18n: proposed command missing leading dash

Jiang Xin <worldhello.net@gmail.com> writes:
Show 18 quoted lines
> 2014-03-05 2:40 GMT+08:00 Junio C Hamano <gitster@pobox.com>:
>> From: Sandy Carter <sandy.carter@savoirfairelinux.com>
>> Date: Mon,  3 Mar 2014 09:55:53 -0500
>>
>> Add missing leading dash to proposed commands in french output when
>> using the command:
>>     git branch --set-upstream remotename/branchname
>> and when upstream is gone
>>
>> Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
>> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>> ---
>>
>>  * Forwarding to the i18n coordinator.  I don't do French, but this
>>    seems trivially correct.
>
> Applied to maint branch of git://github.com/git-l10n/git-po, and can be
> merged to master directly.
Thanks.

← back to recent threads