All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] l10n: index-pack: use plural string instead of normal one
@ 2016-04-08 20:02 Vasco Almeida
  2016-04-08 20:02 ` [PATCH 2/7] l10n: unpack-trees: mark strings for translation Vasco Almeida
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Vasco Almeida @ 2016-04-08 20:02 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Jiang Xin

Git could output "completed with 1 local objects", but in this case
using "object" instead of "objects" is the correct form.
Use Q_() instead of _().

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 builtin/index-pack.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 2d1eb8b..e8c71fc 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1250,7 +1250,9 @@ static void conclude_pack(int fix_thin_pack, const char *curr_pack, unsigned cha
 		       nr_unresolved * sizeof(*objects));
 		f = sha1fd(output_fd, curr_pack);
 		fix_unresolved_deltas(f);
-		strbuf_addf(&msg, _("completed with %d local objects"),
+		strbuf_addf(&msg, Q_("completed with %d local object",
+				     "completed with %d local objects",
+				     nr_objects - nr_objects_initial),
 			    nr_objects - nr_objects_initial);
 		stop_progress_msg(&progress, msg.buf);
 		strbuf_release(&msg);
-- 
2.1.4

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

* [PATCH 2/7] l10n: unpack-trees: mark strings for translation
  2016-04-08 20:02 [PATCH 1/7] l10n: index-pack: use plural string instead of normal one Vasco Almeida
@ 2016-04-08 20:02 ` Vasco Almeida
  2016-04-08 20:23   ` Junio C Hamano
  2016-04-08 20:02 ` [PATCH 3/7] l10n: git-parse-remote.sh: " Vasco Almeida
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Vasco Almeida @ 2016-04-08 20:02 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Jiang Xin

Mark strings seen by the user inside setup_unpack_trees_porcelain() and
display_error_msgs() functions for translation.

One case Git outputs the named strings is when the user does some editing to
a file on some branch and then checks out other branch, but that file
changes by the checkout. This is the case of the first string marked.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 unpack-trees.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/unpack-trees.c b/unpack-trees.c
index 9f55cc2..4bc6b4f 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -61,21 +61,21 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
 	const char *cmd2 = strcmp(cmd, "checkout") ? cmd : "switch branches";
 
 	if (advice_commit_before_merge)
-		msg = "Your local changes to the following files would be overwritten by %s:\n%%s"
-			"Please, commit your changes or stash them before you can %s.";
+		msg = _("Your local changes to the following files would be overwritten by %s:\n%%s"
+			"Please, commit your changes or stash them before you can %s.");
 	else
-		msg = "Your local changes to the following files would be overwritten by %s:\n%%s";
+		msg = _("Your local changes to the following files would be overwritten by %s:\n%%s");
 	msgs[ERROR_WOULD_OVERWRITE] = msgs[ERROR_NOT_UPTODATE_FILE] =
 		xstrfmt(msg, cmd, cmd2);
 
 	msgs[ERROR_NOT_UPTODATE_DIR] =
-		"Updating the following directories would lose untracked files in it:\n%s";
+		_("Updating the following directories would lose untracked files in it:\n%s");
 
 	if (advice_commit_before_merge)
-		msg = "The following untracked working tree files would be %s by %s:\n%%s"
-			"Please move or remove them before you can %s.";
+		msg = _("The following untracked working tree files would be %s by %s:\n%%s"
+			"Please move or remove them before you can %s.");
 	else
-		msg = "The following untracked working tree files would be %s by %s:\n%%s";
+		msg = _("The following untracked working tree files would be %s by %s:\n%%s");
 
 	msgs[ERROR_WOULD_LOSE_UNTRACKED_REMOVED] = xstrfmt(msg, "removed", cmd, cmd2);
 	msgs[ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN] = xstrfmt(msg, "overwritten", cmd, cmd2);
@@ -84,14 +84,14 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
 	 * Special case: ERROR_BIND_OVERLAP refers to a pair of paths, we
 	 * cannot easily display it as a list.
 	 */
-	msgs[ERROR_BIND_OVERLAP] = "Entry '%s' overlaps with '%s'.  Cannot bind.";
+	msgs[ERROR_BIND_OVERLAP] = _("Entry '%s' overlaps with '%s'.  Cannot bind.");
 
 	msgs[ERROR_SPARSE_NOT_UPTODATE_FILE] =
-		"Cannot update sparse checkout: the following entries are not up-to-date:\n%s";
+		_("Cannot update sparse checkout: the following entries are not up-to-date:\n%s");
 	msgs[ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN] =
-		"The following Working tree files would be overwritten by sparse checkout update:\n%s";
+		_("The following Working tree files would be overwritten by sparse checkout update:\n%s");
 	msgs[ERROR_WOULD_LOSE_ORPHANED_REMOVED] =
-		"The following Working tree files would be removed by sparse checkout update:\n%s";
+		_("The following Working tree files would be removed by sparse checkout update:\n%s");
 
 	opts->show_all_errors = 1;
 	/* rejected paths may not have a static buffer */
@@ -168,7 +168,7 @@ static void display_error_msgs(struct unpack_trees_options *o)
 		string_list_clear(rejects, 0);
 	}
 	if (something_displayed)
-		fprintf(stderr, "Aborting\n");
+		fprintf(stderr, _("Aborting\n"));
 }
 
 /*
-- 
2.1.4

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

* [PATCH 3/7] l10n: git-parse-remote.sh: mark strings for translation
  2016-04-08 20:02 [PATCH 1/7] l10n: index-pack: use plural string instead of normal one Vasco Almeida
  2016-04-08 20:02 ` [PATCH 2/7] l10n: unpack-trees: mark strings for translation Vasco Almeida
@ 2016-04-08 20:02 ` Vasco Almeida
  2016-04-08 20:30   ` Junio C Hamano
  2016-04-08 20:02 ` [PATCH 4/7] l10n: builtin/pull.c: " Vasco Almeida
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Vasco Almeida @ 2016-04-08 20:02 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Jiang Xin

Change Makefile to include git-parse-remote.sh in LOCALIZED_SH.

TODO: remove 3rd argument of error_on_missing_default_upstream function
that is no longer required.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 Makefile            |  2 +-
 git-parse-remote.sh | 49 ++++++++++++++++++++++++++++++++-----------------
 2 files changed, 33 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index 2742a69..2249bab 100644
--- a/Makefile
+++ b/Makefile
@@ -2069,7 +2069,7 @@ XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
 	--keyword=gettextln --keyword=eval_gettextln
 XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl
 LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
-LOCALIZED_SH = $(SCRIPT_SH)
+LOCALIZED_SH = $(SCRIPT_SH) git-parse-remote.sh
 LOCALIZED_PERL = $(SCRIPT_PERL)
 
 ifdef XGETTEXT_INCLUDE_TESTS
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 55fe8d5..ee3ad1f 100644
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -6,6 +6,9 @@
 # this would fail in that case and would issue an error message.
 GIT_DIR=$(git rev-parse -q --git-dir) || :;
 
+. git-sh-setup
+. git-sh-i18n
+
 get_default_remote () {
 	curr_branch=$(git symbolic-ref -q HEAD)
 	curr_branch="${curr_branch#refs/heads/}"
@@ -56,11 +59,12 @@ get_remote_merge_branch () {
 error_on_missing_default_upstream () {
 	cmd="$1"
 	op_type="$2"
-	op_prep="$3"
+	op_prep="$3" # FIXME: op_prep is no longer used
 	example="$4"
 	branch_name=$(git symbolic-ref -q HEAD)
+	display_branch_name="${branch_name#refs/heads/}"
 	# If there's only one remote, use that in the suggestion
-	remote="<remote>"
+	remote=$(gettext "<remote>")
 	if test $(git remote | wc -l) = 1
 	then
 		remote=$(git remote)
@@ -68,22 +72,33 @@ error_on_missing_default_upstream () {
 
 	if test -z "$branch_name"
 	then
-		echo "You are not currently on a branch. Please specify which
-branch you want to $op_type $op_prep. See git-${cmd}(1) for details.
-
-    $example
-"
+		gettextln "You are not currently on a branch."
+		if test $op_type = "rebase"
+		then
+			gettextln "Please specify which branch you want to rebase against."
+		else
+			gettextln "Please specify which branch you want to merge with."
+		fi
+		eval_gettextln "See git-\${cmd}(1) for details."
+		echo
+		echo "    $example"
+		echo
 	else
-		echo "There is no tracking information for the current branch.
-Please specify which branch you want to $op_type $op_prep.
-See git-${cmd}(1) for details
-
-    $example
-
-If you wish to set tracking information for this branch you can do so with:
-
-    git branch --set-upstream-to=$remote/<branch> ${branch_name#refs/heads/}
-"
+		gettextln "There is no tracking information for the current branch."
+		if test $op_type = "rebase"
+		then
+			gettextln "Please specify which branch you want to rebase against."
+		else
+			gettextln "Please specify which branch you want to merge with."
+		fi
+		eval_gettextln "See git-\${cmd}(1) for details."
+		echo
+		echo "    $example"
+		echo
+		gettextln "If you wish to set tracking information for this branch you can do so with:"
+		echo
+		eval_gettextln "    git branch --set-upstream-to=\$remote/<branch> \$display_branch_name"
+		echo
 	fi
 	exit 1
 }
-- 
2.1.4

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

* [PATCH 4/7] l10n: builtin/pull.c: mark strings for translation
  2016-04-08 20:02 [PATCH 1/7] l10n: index-pack: use plural string instead of normal one Vasco Almeida
  2016-04-08 20:02 ` [PATCH 2/7] l10n: unpack-trees: mark strings for translation Vasco Almeida
  2016-04-08 20:02 ` [PATCH 3/7] l10n: git-parse-remote.sh: " Vasco Almeida
@ 2016-04-08 20:02 ` Vasco Almeida
  2016-04-08 20:33   ` Junio C Hamano
  2016-04-08 20:02 ` [PATCH 5/7] l10n: builtin/pull.c: split strings marked " Vasco Almeida
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Vasco Almeida @ 2016-04-08 20:02 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Jiang Xin

Some translations might also translate "<remote>" and "<branch>".

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 builtin/pull.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/pull.c b/builtin/pull.c
index 10eff03..a99d6b9 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -458,13 +458,13 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs
 			fprintf_ln(stderr, _("Please specify which branch you want to merge with."));
 		fprintf_ln(stderr, _("See git-pull(1) for details."));
 		fprintf(stderr, "\n");
-		fprintf_ln(stderr, "    git pull <remote> <branch>");
+		fprintf_ln(stderr, _("    git pull <remote> <branch>"));
 		fprintf(stderr, "\n");
 	} else if (!curr_branch->merge_nr) {
 		const char *remote_name = NULL;
 
 		if (for_each_remote(get_only_remote, &remote_name) || !remote_name)
-			remote_name = "<remote>";
+			remote_name = _("<remote>");
 
 		fprintf_ln(stderr, _("There is no tracking information for the current branch."));
 		if (opt_rebase)
@@ -473,7 +473,7 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs
 			fprintf_ln(stderr, _("Please specify which branch you want to merge with."));
 		fprintf_ln(stderr, _("See git-pull(1) for details."));
 		fprintf(stderr, "\n");
-		fprintf_ln(stderr, "    git pull <remote> <branch>");
+		fprintf_ln(stderr, _("    git pull <remote> <branch>"));
 		fprintf(stderr, "\n");
 		fprintf_ln(stderr, _("If you wish to set tracking information for this branch you can do so with:\n"
 				"\n"
-- 
2.1.4

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

* [PATCH 5/7] l10n: builtin/pull.c: split strings marked for translation
  2016-04-08 20:02 [PATCH 1/7] l10n: index-pack: use plural string instead of normal one Vasco Almeida
                   ` (2 preceding siblings ...)
  2016-04-08 20:02 ` [PATCH 4/7] l10n: builtin/pull.c: " Vasco Almeida
@ 2016-04-08 20:02 ` Vasco Almeida
  2016-04-08 20:02 ` [PATCH 6/7] l10n: mv.c: add a comma ',' to string Vasco Almeida
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Vasco Almeida @ 2016-04-08 20:02 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Jiang Xin

Split string "If you wish to set tracking information
for this branch you can do so with:\n" to match occurring string in
git-parse-remote.sh. In this case, the translator handles it only once.

On the other hand, the translations of the string that were already made
are mark as fuzzy and the translator needs to correct it herself.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 builtin/pull.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/pull.c b/builtin/pull.c
index a99d6b9..ac942f6 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -475,9 +475,9 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs
 		fprintf(stderr, "\n");
 		fprintf_ln(stderr, _("    git pull <remote> <branch>"));
 		fprintf(stderr, "\n");
-		fprintf_ln(stderr, _("If you wish to set tracking information for this branch you can do so with:\n"
-				"\n"
-				"    git branch --set-upstream-to=%s/<branch> %s\n"),
+		fprintf_ln(stderr, _("If you wish to set tracking information for this branch you can do so with:"));
+		fprintf(stderr, "\n");
+		fprintf_ln(stderr, _("    git branch --set-upstream-to=%s/<branch> %s\n"),
 				remote_name, curr_branch->name);
 	} else
 		fprintf_ln(stderr, _("Your configuration specifies to merge with the ref '%s'\n"
-- 
2.1.4

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

* [PATCH 6/7] l10n: mv.c: add a comma ',' to string
  2016-04-08 20:02 [PATCH 1/7] l10n: index-pack: use plural string instead of normal one Vasco Almeida
                   ` (3 preceding siblings ...)
  2016-04-08 20:02 ` [PATCH 5/7] l10n: builtin/pull.c: split strings marked " Vasco Almeida
@ 2016-04-08 20:02 ` Vasco Almeida
  2016-04-08 20:35   ` Junio C Hamano
  2016-04-08 20:02 ` [PATCH 7/7] l10n: builtin/branch.c: mark option for translation Vasco Almeida
  2016-04-08 20:26 ` [PATCH 1/7] l10n: index-pack: use plural string instead of normal one Junio C Hamano
  6 siblings, 1 reply; 14+ messages in thread
From: Vasco Almeida @ 2016-04-08 20:02 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Jiang Xin

Add a comma to string marked for translation. Make the string match the
one in rm.c. Now translators have do handle this string only once.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 builtin/mv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/mv.c b/builtin/mv.c
index aeae855..1bf8df1 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -69,7 +69,7 @@ static void prepare_move_submodule(const char *src, int first,
 	if (!S_ISGITLINK(active_cache[first]->ce_mode))
 		die(_("Directory %s is in index and no submodule?"), src);
 	if (!is_staging_gitmodules_ok())
-		die(_("Please stage your changes to .gitmodules or stash them to proceed"));
+		die(_("Please, stage your changes to .gitmodules or stash them to proceed"));
 	strbuf_addf(&submodule_dotgit, "%s/.git", src);
 	*submodule_gitfile = read_gitfile(submodule_dotgit.buf);
 	if (*submodule_gitfile)
-- 
2.1.4

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

* [PATCH 7/7] l10n: builtin/branch.c: mark option for translation
  2016-04-08 20:02 [PATCH 1/7] l10n: index-pack: use plural string instead of normal one Vasco Almeida
                   ` (4 preceding siblings ...)
  2016-04-08 20:02 ` [PATCH 6/7] l10n: mv.c: add a comma ',' to string Vasco Almeida
@ 2016-04-08 20:02 ` Vasco Almeida
  2016-04-08 20:26 ` [PATCH 1/7] l10n: index-pack: use plural string instead of normal one Junio C Hamano
  6 siblings, 0 replies; 14+ messages in thread
From: Vasco Almeida @ 2016-04-08 20:02 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Jiang Xin

Mark description and parameter for option "set-upstream-to" for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 builtin/branch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 7b45b6b..5ab106b 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -620,7 +620,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 			BRANCH_TRACK_EXPLICIT),
 		OPT_SET_INT( 0, "set-upstream",  &track, N_("change upstream info"),
 			BRANCH_TRACK_OVERRIDE),
-		OPT_STRING('u', "set-upstream-to", &new_upstream, "upstream", "change the upstream info"),
+		OPT_STRING('u', "set-upstream-to", &new_upstream, N_("upstream"), N_("change the upstream info")),
 		OPT_BOOL(0, "unset-upstream", &unset_upstream, "Unset the upstream info"),
 		OPT__COLOR(&branch_use_color, N_("use colored output")),
 		OPT_SET_INT('r', "remotes",     &filter.kind, N_("act on remote-tracking branches"),
-- 
2.1.4

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

* Re: [PATCH 2/7] l10n: unpack-trees: mark strings for translation
  2016-04-08 20:02 ` [PATCH 2/7] l10n: unpack-trees: mark strings for translation Vasco Almeida
@ 2016-04-08 20:23   ` Junio C Hamano
  2016-04-09 12:19     ` Vasco Almeida
  0 siblings, 1 reply; 14+ messages in thread
From: Junio C Hamano @ 2016-04-08 20:23 UTC (permalink / raw)
  To: Vasco Almeida; +Cc: git, Jiang Xin

Vasco Almeida <vascomalmeida@sapo.pt> writes:

> Mark strings seen by the user inside setup_unpack_trees_porcelain() and
> display_error_msgs() functions for translation.
>
> One case Git outputs the named strings is when the user does some editing to
> a file on some branch and then checks out other branch, but that file
> changes by the checkout. This is the case of the first string marked.

The second paragraph puzzling.  Other strings are not shown at all?
Or is it just you didn't bother explaining the others cases?

Either case, it is not immediately clear why you felt that one
string among others deserve more attention.  Care to elaborate?

In the patch itself I did not find anything questionable, though.

Thanks.

>
> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
> ---
>  unpack-trees.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/unpack-trees.c b/unpack-trees.c
> index 9f55cc2..4bc6b4f 100644
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -61,21 +61,21 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
>  	const char *cmd2 = strcmp(cmd, "checkout") ? cmd : "switch branches";
>  
>  	if (advice_commit_before_merge)
> -		msg = "Your local changes to the following files would be overwritten by %s:\n%%s"
> -			"Please, commit your changes or stash them before you can %s.";
> +		msg = _("Your local changes to the following files would be overwritten by %s:\n%%s"
> +			"Please, commit your changes or stash them before you can %s.");
>  	else
> -		msg = "Your local changes to the following files would be overwritten by %s:\n%%s";
> +		msg = _("Your local changes to the following files would be overwritten by %s:\n%%s");
>  	msgs[ERROR_WOULD_OVERWRITE] = msgs[ERROR_NOT_UPTODATE_FILE] =
>  		xstrfmt(msg, cmd, cmd2);
>  
>  	msgs[ERROR_NOT_UPTODATE_DIR] =
> -		"Updating the following directories would lose untracked files in it:\n%s";
> +		_("Updating the following directories would lose untracked files in it:\n%s");
>  
>  	if (advice_commit_before_merge)
> -		msg = "The following untracked working tree files would be %s by %s:\n%%s"
> -			"Please move or remove them before you can %s.";
> +		msg = _("The following untracked working tree files would be %s by %s:\n%%s"
> +			"Please move or remove them before you can %s.");
>  	else
> -		msg = "The following untracked working tree files would be %s by %s:\n%%s";
> +		msg = _("The following untracked working tree files would be %s by %s:\n%%s");
>  
>  	msgs[ERROR_WOULD_LOSE_UNTRACKED_REMOVED] = xstrfmt(msg, "removed", cmd, cmd2);
>  	msgs[ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN] = xstrfmt(msg, "overwritten", cmd, cmd2);
> @@ -84,14 +84,14 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
>  	 * Special case: ERROR_BIND_OVERLAP refers to a pair of paths, we
>  	 * cannot easily display it as a list.
>  	 */
> -	msgs[ERROR_BIND_OVERLAP] = "Entry '%s' overlaps with '%s'.  Cannot bind.";
> +	msgs[ERROR_BIND_OVERLAP] = _("Entry '%s' overlaps with '%s'.  Cannot bind.");
>  
>  	msgs[ERROR_SPARSE_NOT_UPTODATE_FILE] =
> -		"Cannot update sparse checkout: the following entries are not up-to-date:\n%s";
> +		_("Cannot update sparse checkout: the following entries are not up-to-date:\n%s");
>  	msgs[ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN] =
> -		"The following Working tree files would be overwritten by sparse checkout update:\n%s";
> +		_("The following Working tree files would be overwritten by sparse checkout update:\n%s");
>  	msgs[ERROR_WOULD_LOSE_ORPHANED_REMOVED] =
> -		"The following Working tree files would be removed by sparse checkout update:\n%s";
> +		_("The following Working tree files would be removed by sparse checkout update:\n%s");
>  
>  	opts->show_all_errors = 1;
>  	/* rejected paths may not have a static buffer */
> @@ -168,7 +168,7 @@ static void display_error_msgs(struct unpack_trees_options *o)
>  		string_list_clear(rejects, 0);
>  	}
>  	if (something_displayed)
> -		fprintf(stderr, "Aborting\n");
> +		fprintf(stderr, _("Aborting\n"));
>  }
>  
>  /*

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

* Re: [PATCH 1/7] l10n: index-pack: use plural string instead of normal one
  2016-04-08 20:02 [PATCH 1/7] l10n: index-pack: use plural string instead of normal one Vasco Almeida
                   ` (5 preceding siblings ...)
  2016-04-08 20:02 ` [PATCH 7/7] l10n: builtin/branch.c: mark option for translation Vasco Almeida
@ 2016-04-08 20:26 ` Junio C Hamano
  6 siblings, 0 replies; 14+ messages in thread
From: Junio C Hamano @ 2016-04-08 20:26 UTC (permalink / raw)
  To: Vasco Almeida; +Cc: git, Jiang Xin

Vasco Almeida <vascomalmeida@sapo.pt> writes:

> Subject: Re: [PATCH 1/7] l10n: index-pack: use plural string instead of normal one

These are probably better prefixed with "i18n:" (i.e. enable
translation into many languages) not "l10n:" (i.e. actually
translate for languages).

> Git could output "completed with 1 local objects", but in this case
> using "object" instead of "objects" is the correct form.
> Use Q_() instead of _().
>
> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
> ---
>  builtin/index-pack.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/index-pack.c b/builtin/index-pack.c
> index 2d1eb8b..e8c71fc 100644
> --- a/builtin/index-pack.c
> +++ b/builtin/index-pack.c
> @@ -1250,7 +1250,9 @@ static void conclude_pack(int fix_thin_pack, const char *curr_pack, unsigned cha
>  		       nr_unresolved * sizeof(*objects));
>  		f = sha1fd(output_fd, curr_pack);
>  		fix_unresolved_deltas(f);
> -		strbuf_addf(&msg, _("completed with %d local objects"),
> +		strbuf_addf(&msg, Q_("completed with %d local object",
> +				     "completed with %d local objects",
> +				     nr_objects - nr_objects_initial),
>  			    nr_objects - nr_objects_initial);

Looks sensible.  It seems that all existing instances of Q_() that
have "%d" for the plural one also use "%d" for the singular, so this
update is consistent with them.

I however wonder if we want to say "completed with 1 local object"
in the message, which would allow translation of it into "completed
with one local object" etc., but that is a separate topic.

Thanks.

>  		stop_progress_msg(&progress, msg.buf);
>  		strbuf_release(&msg);

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

* Re: [PATCH 3/7] l10n: git-parse-remote.sh: mark strings for translation
  2016-04-08 20:02 ` [PATCH 3/7] l10n: git-parse-remote.sh: " Vasco Almeida
@ 2016-04-08 20:30   ` Junio C Hamano
  0 siblings, 0 replies; 14+ messages in thread
From: Junio C Hamano @ 2016-04-08 20:30 UTC (permalink / raw)
  To: Vasco Almeida; +Cc: git, Jiang Xin

Vasco Almeida <vascomalmeida@sapo.pt> writes:

> +		gettextln "You are not currently on a branch."
> +		if test $op_type = "rebase"

	if test "$op_type" = rebase

that is, $op_type could be an empty string that 'test' may not even
see hence it should be double-quoted to ensure 'test' sees an empty
string in that case, while "rebase" cannot be an empty string by
definition so there is no need to quote it.

Thanks.

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

* Re: [PATCH 4/7] l10n: builtin/pull.c: mark strings for translation
  2016-04-08 20:02 ` [PATCH 4/7] l10n: builtin/pull.c: " Vasco Almeida
@ 2016-04-08 20:33   ` Junio C Hamano
  2016-04-09 12:34     ` Vasco Almeida
  0 siblings, 1 reply; 14+ messages in thread
From: Junio C Hamano @ 2016-04-08 20:33 UTC (permalink / raw)
  To: Vasco Almeida; +Cc: git, Jiang Xin

Vasco Almeida <vascomalmeida@sapo.pt> writes:

> Some translations might also translate "<remote>" and "<branch>".
> ...
>  		fprintf_ln(stderr, _("See git-pull(1) for details."));
>  		fprintf(stderr, "\n");
> -		fprintf_ln(stderr, "    git pull <remote> <branch>");
> +		fprintf_ln(stderr, _("    git pull <remote> <branch>"));

But "git pull" itself must never be translated, and there is no hint
given to those who are working on *.po files to prevent it.

Wouldn't it make more sense to do it like this?

	fprintf_ln(stderr, "    git pull <%s> <%s>", _("remote"), _("branch"));

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

* Re: [PATCH 6/7] l10n: mv.c: add a comma ',' to string
  2016-04-08 20:02 ` [PATCH 6/7] l10n: mv.c: add a comma ',' to string Vasco Almeida
@ 2016-04-08 20:35   ` Junio C Hamano
  0 siblings, 0 replies; 14+ messages in thread
From: Junio C Hamano @ 2016-04-08 20:35 UTC (permalink / raw)
  To: Vasco Almeida; +Cc: git, Jiang Xin

Vasco Almeida <vascomalmeida@sapo.pt> writes:

> Add a comma to string marked for translation. Make the string match the
> one in rm.c. Now translators have do handle this string only once.

I suspect these "comma after Please" is a French invention.

Aiming to reduce these minor variants is a good goal, but wouldn't
we want to go in the opposite direction?

>
> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
> ---
>  builtin/mv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/mv.c b/builtin/mv.c
> index aeae855..1bf8df1 100644
> --- a/builtin/mv.c
> +++ b/builtin/mv.c
> @@ -69,7 +69,7 @@ static void prepare_move_submodule(const char *src, int first,
>  	if (!S_ISGITLINK(active_cache[first]->ce_mode))
>  		die(_("Directory %s is in index and no submodule?"), src);
>  	if (!is_staging_gitmodules_ok())
> -		die(_("Please stage your changes to .gitmodules or stash them to proceed"));
> +		die(_("Please, stage your changes to .gitmodules or stash them to proceed"));
>  	strbuf_addf(&submodule_dotgit, "%s/.git", src);
>  	*submodule_gitfile = read_gitfile(submodule_dotgit.buf);
>  	if (*submodule_gitfile)

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

* Re: [PATCH 2/7] l10n: unpack-trees: mark strings for translation
  2016-04-08 20:23   ` Junio C Hamano
@ 2016-04-09 12:19     ` Vasco Almeida
  0 siblings, 0 replies; 14+ messages in thread
From: Vasco Almeida @ 2016-04-09 12:19 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Jiang Xin

Às 20:23 de 08-04-2016, Junio C Hamano escreveu:
> Vasco Almeida <vascomalmeida@sapo.pt> writes:
> 
>> Mark strings seen by the user inside setup_unpack_trees_porcelain() and
>> display_error_msgs() functions for translation.
>>
>> One case Git outputs the named strings is when the user does some editing to
>> a file on some branch and then checks out other branch, but that file
>> changes by the checkout. This is the case of the first string marked.
> 
> The second paragraph puzzling.  Other strings are not shown at all?
> Or is it just you didn't bother explaining the others cases?
> 
> Either case, it is not immediately clear why you felt that one
> string among others deserve more attention.  Care to elaborate?

I meant that as an example, which was the situation I was when I found
the untranslated string.
I should have written that outside the commit message, as a note.
I'm going to remove that paragraph since it isn’t irrelevant and
confusing. Hope I answered you.

> 
> In the patch itself I did not find anything questionable, though.
> 
> Thanks.
> 
>>
>> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
>> ---
>>  unpack-trees.c | 24 ++++++++++++------------
>>  1 file changed, 12 insertions(+), 12 deletions(-)
>>
>> diff --git a/unpack-trees.c b/unpack-trees.c
>> index 9f55cc2..4bc6b4f 100644
>> --- a/unpack-trees.c
>> +++ b/unpack-trees.c
>> @@ -61,21 +61,21 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
>>  	const char *cmd2 = strcmp(cmd, "checkout") ? cmd : "switch branches";
>>  
>>  	if (advice_commit_before_merge)
>> -		msg = "Your local changes to the following files would be overwritten by %s:\n%%s"
>> -			"Please, commit your changes or stash them before you can %s.";
>> +		msg = _("Your local changes to the following files would be overwritten by %s:\n%%s"
>> +			"Please, commit your changes or stash them before you can %s.");
>>  	else
>> -		msg = "Your local changes to the following files would be overwritten by %s:\n%%s";
>> +		msg = _("Your local changes to the following files would be overwritten by %s:\n%%s");
>>  	msgs[ERROR_WOULD_OVERWRITE] = msgs[ERROR_NOT_UPTODATE_FILE] =
>>  		xstrfmt(msg, cmd, cmd2);
>>  
>>  	msgs[ERROR_NOT_UPTODATE_DIR] =
>> -		"Updating the following directories would lose untracked files in it:\n%s";
>> +		_("Updating the following directories would lose untracked files in it:\n%s");
>>  
>>  	if (advice_commit_before_merge)
>> -		msg = "The following untracked working tree files would be %s by %s:\n%%s"
>> -			"Please move or remove them before you can %s.";
>> +		msg = _("The following untracked working tree files would be %s by %s:\n%%s"
>> +			"Please move or remove them before you can %s.");
>>  	else
>> -		msg = "The following untracked working tree files would be %s by %s:\n%%s";
>> +		msg = _("The following untracked working tree files would be %s by %s:\n%%s");
>>  
>>  	msgs[ERROR_WOULD_LOSE_UNTRACKED_REMOVED] = xstrfmt(msg, "removed", cmd, cmd2);
>>  	msgs[ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN] = xstrfmt(msg, "overwritten", cmd, cmd2);
>> @@ -84,14 +84,14 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
>>  	 * Special case: ERROR_BIND_OVERLAP refers to a pair of paths, we
>>  	 * cannot easily display it as a list.
>>  	 */
>> -	msgs[ERROR_BIND_OVERLAP] = "Entry '%s' overlaps with '%s'.  Cannot bind.";
>> +	msgs[ERROR_BIND_OVERLAP] = _("Entry '%s' overlaps with '%s'.  Cannot bind.");
>>  
>>  	msgs[ERROR_SPARSE_NOT_UPTODATE_FILE] =
>> -		"Cannot update sparse checkout: the following entries are not up-to-date:\n%s";
>> +		_("Cannot update sparse checkout: the following entries are not up-to-date:\n%s");
>>  	msgs[ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN] =
>> -		"The following Working tree files would be overwritten by sparse checkout update:\n%s";
>> +		_("The following Working tree files would be overwritten by sparse checkout update:\n%s");
>>  	msgs[ERROR_WOULD_LOSE_ORPHANED_REMOVED] =
>> -		"The following Working tree files would be removed by sparse checkout update:\n%s";
>> +		_("The following Working tree files would be removed by sparse checkout update:\n%s");
>>  
>>  	opts->show_all_errors = 1;
>>  	/* rejected paths may not have a static buffer */
>> @@ -168,7 +168,7 @@ static void display_error_msgs(struct unpack_trees_options *o)
>>  		string_list_clear(rejects, 0);
>>  	}
>>  	if (something_displayed)
>> -		fprintf(stderr, "Aborting\n");
>> +		fprintf(stderr, _("Aborting\n"));
>>  }
>>  
>>  /*

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

* Re: [PATCH 4/7] l10n: builtin/pull.c: mark strings for translation
  2016-04-08 20:33   ` Junio C Hamano
@ 2016-04-09 12:34     ` Vasco Almeida
  0 siblings, 0 replies; 14+ messages in thread
From: Vasco Almeida @ 2016-04-09 12:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Jiang Xin

Às 20:33 de 08-04-2016, Junio C Hamano escreveu:
> Vasco Almeida <vascomalmeida@sapo.pt> writes:
> 
>> Some translations might also translate "<remote>" and "<branch>".
>> ...
>>  		fprintf_ln(stderr, _("See git-pull(1) for details."));
>>  		fprintf(stderr, "\n");
>> -		fprintf_ln(stderr, "    git pull <remote> <branch>");
>> +		fprintf_ln(stderr, _("    git pull <remote> <branch>"));
> 
> But "git pull" itself must never be translated, and there is no hint
> given to those who are working on *.po files to prevent it.
> 
> Wouldn't it make more sense to do it like this?
> 
> 	fprintf_ln(stderr, "    git pull <%s> <%s>", _("remote"), _("branch"));
> 
Yes, I think the way you suggest is better, since it prevents
translation mistakes. I'll do the same to

eval_gettextln "    git branch --set-upstream-to=\$remote/<branch>\$display_branch_name"

in git-parse-remote.sh ending.

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

end of thread, other threads:[~2016-04-09 12:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-08 20:02 [PATCH 1/7] l10n: index-pack: use plural string instead of normal one Vasco Almeida
2016-04-08 20:02 ` [PATCH 2/7] l10n: unpack-trees: mark strings for translation Vasco Almeida
2016-04-08 20:23   ` Junio C Hamano
2016-04-09 12:19     ` Vasco Almeida
2016-04-08 20:02 ` [PATCH 3/7] l10n: git-parse-remote.sh: " Vasco Almeida
2016-04-08 20:30   ` Junio C Hamano
2016-04-08 20:02 ` [PATCH 4/7] l10n: builtin/pull.c: " Vasco Almeida
2016-04-08 20:33   ` Junio C Hamano
2016-04-09 12:34     ` Vasco Almeida
2016-04-08 20:02 ` [PATCH 5/7] l10n: builtin/pull.c: split strings marked " Vasco Almeida
2016-04-08 20:02 ` [PATCH 6/7] l10n: mv.c: add a comma ',' to string Vasco Almeida
2016-04-08 20:35   ` Junio C Hamano
2016-04-08 20:02 ` [PATCH 7/7] l10n: builtin/branch.c: mark option for translation Vasco Almeida
2016-04-08 20:26 ` [PATCH 1/7] l10n: index-pack: use plural string instead of normal one Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.