git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/3] i18n: setup: mark error messages for translation
@ 2016-08-08 11:15 Vasco Almeida
  2016-08-08 11:16 ` [PATCH 2/3] i18n: archive: mark errors " Vasco Almeida
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Vasco Almeida @ 2016-08-08 11:15 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Ævar Arnfjörð Bjarmason

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 setup.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/setup.c b/setup.c
index 6d0e0c9..fe572b8 100644
--- a/setup.c
+++ b/setup.c
@@ -759,9 +759,9 @@ static const char *setup_bare_git_dir(struct strbuf *cwd, int offset,
 static const char *setup_nongit(const char *cwd, int *nongit_ok)
 {
 	if (!nongit_ok)
-		die("Not a git repository (or any of the parent directories): %s", DEFAULT_GIT_DIR_ENVIRONMENT);
+		die(_("Not a git repository (or any of the parent directories): %s"), DEFAULT_GIT_DIR_ENVIRONMENT);
 	if (chdir(cwd))
-		die_errno("Cannot come back to cwd");
+		die_errno(_("Cannot come back to cwd"));
 	*nongit_ok = 1;
 	return NULL;
 }
@@ -842,7 +842,7 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)
 		*nongit_ok = 0;
 
 	if (strbuf_getcwd(&cwd))
-		die_errno("Unable to read current working directory");
+		die_errno(_("Unable to read current working directory"));
 	offset = cwd.len;
 
 	/*
@@ -912,19 +912,19 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)
 			if (parent_device != current_device) {
 				if (nongit_ok) {
 					if (chdir(cwd.buf))
-						die_errno("Cannot come back to cwd");
+						die_errno(_("Cannot come back to cwd"));
 					*nongit_ok = 1;
 					return NULL;
 				}
 				strbuf_setlen(&cwd, offset);
-				die("Not a git repository (or any parent up to mount point %s)\n"
-				"Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).",
+				die(_("Not a git repository (or any parent up to mount point %s)\n"
+				"Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)."),
 				    cwd.buf);
 			}
 		}
 		if (chdir("..")) {
 			strbuf_setlen(&cwd, offset);
-			die_errno("Cannot change to '%s/..'", cwd.buf);
+			die_errno(_("Cannot change to '%s/..'"), cwd.buf);
 		}
 		offset = offset_parent;
 	}
@@ -986,9 +986,9 @@ int git_config_perm(const char *var, const char *value)
 	/* A filemode value was given: 0xxx */
 
 	if ((i & 0600) != 0600)
-		die("Problem with core.sharedRepository filemode value "
+		die(_("Problem with core.sharedRepository filemode value "
 		    "(0%.3o).\nThe owner of files must always have "
-		    "read and write permissions.", i);
+		    "read and write permissions."), i);
 
 	/*
 	 * Mask filemode value. Others can not get write permission.
-- 
2.7.4


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

* [PATCH 2/3] i18n: archive: mark errors for translation
  2016-08-08 11:15 [PATCH 1/3] i18n: setup: mark error messages for translation Vasco Almeida
@ 2016-08-08 11:16 ` Vasco Almeida
  2016-08-09 19:35   ` Junio C Hamano
  2016-08-08 11:16 ` [PATCH 3/3] i18n: git-stash: mark message " Vasco Almeida
  2016-08-10 10:50 ` [PATCH v2 1/3] i18n: setup: mark error messages " Vasco Almeida
  2 siblings, 1 reply; 9+ messages in thread
From: Vasco Almeida @ 2016-08-08 11:16 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Ævar Arnfjörð Bjarmason

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 archive.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/archive.c b/archive.c
index 42df974..dde1ab4 100644
--- a/archive.c
+++ b/archive.c
@@ -458,11 +458,11 @@ static int parse_archive_args(int argc, const char **argv,
 	argc = parse_options(argc, argv, NULL, opts, archive_usage, 0);
 
 	if (remote)
-		die("Unexpected option --remote");
+		die(_("Unexpected option --remote"));
 	if (exec)
-		die("Option --exec can only be used together with --remote");
+		die(_("Option --exec can only be used together with --remote"));
 	if (output)
-		die("Unexpected option --output");
+		die(_("Unexpected option --output"));
 
 	if (!base)
 		base = "";
@@ -484,14 +484,14 @@ static int parse_archive_args(int argc, const char **argv,
 		usage_with_options(archive_usage, opts);
 	*ar = lookup_archiver(format);
 	if (!*ar || (is_remote && !((*ar)->flags & ARCHIVER_REMOTE)))
-		die("Unknown archive format '%s'", format);
+		die(_("Unknown archive format '%s'"), format);
 
 	args->compression_level = Z_DEFAULT_COMPRESSION;
 	if (compression_level != -1) {
 		if ((*ar)->flags & ARCHIVER_WANT_COMPRESSION_LEVELS)
 			args->compression_level = compression_level;
 		else {
-			die("Argument not supported for format '%s': -%d",
+			die(_("Argument not supported for format '%s': -%d"),
 					format, compression_level);
 		}
 	}
-- 
2.7.4


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

* [PATCH 3/3] i18n: git-stash: mark message for translation
  2016-08-08 11:15 [PATCH 1/3] i18n: setup: mark error messages for translation Vasco Almeida
  2016-08-08 11:16 ` [PATCH 2/3] i18n: archive: mark errors " Vasco Almeida
@ 2016-08-08 11:16 ` Vasco Almeida
  2016-08-09 19:36   ` Junio C Hamano
  2016-08-10 10:50 ` [PATCH v2 1/3] i18n: setup: mark error messages " Vasco Almeida
  2 siblings, 1 reply; 9+ messages in thread
From: Vasco Almeida @ 2016-08-08 11:16 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Ævar Arnfjörð Bjarmason

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 git-stash.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-stash.sh b/git-stash.sh
index 22fb8bc..9cbd682 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -265,7 +265,7 @@ save_stash () {
 	create_stash "$stash_msg" $untracked
 	store_stash -m "$stash_msg" -q $w_commit ||
 	die "$(gettext "Cannot save the current status")"
-	say Saved working directory and index state "$stash_msg"
+	say "$(eval_gettext "Saved working directory and index state \$stash_msg")"
 
 	if test -z "$patch_mode"
 	then
-- 
2.7.4


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

* Re: [PATCH 2/3] i18n: archive: mark errors for translation
  2016-08-08 11:16 ` [PATCH 2/3] i18n: archive: mark errors " Vasco Almeida
@ 2016-08-09 19:35   ` Junio C Hamano
  2016-08-10 13:28     ` Vasco Almeida
  0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2016-08-09 19:35 UTC (permalink / raw)
  To: Vasco Almeida; +Cc: git, Ævar Arnfjörð Bjarmason

Vasco Almeida <vascomalmeida@sapo.pt> writes:

> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
> ---
>  archive.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/archive.c b/archive.c
> index 42df974..dde1ab4 100644
> --- a/archive.c
> +++ b/archive.c
> @@ -458,11 +458,11 @@ static int parse_archive_args(int argc, const char **argv,
>  	argc = parse_options(argc, argv, NULL, opts, archive_usage, 0);
>  
>  	if (remote)
> -		die("Unexpected option --remote");
> +		die(_("Unexpected option --remote"));
>  	if (exec)
> -		die("Option --exec can only be used together with --remote");
> +		die(_("Option --exec can only be used together with --remote"));
>  	if (output)
> -		die("Unexpected option --output");
> +		die(_("Unexpected option --output"));
> ...
> -		die("Unknown archive format '%s'", format);
> +		die(_("Unknown archive format '%s'"), format);
> ...
> -			die("Argument not supported for format '%s': -%d",
> +			die(_("Argument not supported for format '%s': -%d"),
>  					format, compression_level);

Hmm, this function is called by write_archive(), which can be called
by the upload-archive process running on the remote end, whose
locale certainly is different from that of your local environment.

If I do not read English and got one of these messages from the
remote end, I can copy that into a search engine to read more about
the error, but if I got it translated into, say, Portuguese, I'd
have a (slightly) harder time dealing with the error, I would think.

Having said that, I expect that sites that expect internatinal
audience to come would run these services in C locale, and other
sites that target audiences in a single locale would choose to use
their favourite single locale, so probably we do not have to worry
about it.

Thanks.

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

* Re: [PATCH 3/3] i18n: git-stash: mark message for translation
  2016-08-08 11:16 ` [PATCH 3/3] i18n: git-stash: mark message " Vasco Almeida
@ 2016-08-09 19:36   ` Junio C Hamano
  0 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2016-08-09 19:36 UTC (permalink / raw)
  To: Vasco Almeida; +Cc: git, Ævar Arnfjörð Bjarmason

Vasco Almeida <vascomalmeida@sapo.pt> writes:

> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
> ---
>  git-stash.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-stash.sh b/git-stash.sh
> index 22fb8bc..9cbd682 100755
> --- a/git-stash.sh
> +++ b/git-stash.sh
> @@ -265,7 +265,7 @@ save_stash () {
>  	create_stash "$stash_msg" $untracked
>  	store_stash -m "$stash_msg" -q $w_commit ||
>  	die "$(gettext "Cannot save the current status")"
> -	say Saved working directory and index state "$stash_msg"
> +	say "$(eval_gettext "Saved working directory and index state \$stash_msg")"
>  
>  	if test -z "$patch_mode"
>  	then

There is another "say" without gettext in pop_stash function.  Don't
you want to do that one, too?

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

* [PATCH v2 1/3] i18n: setup: mark error messages for translation
  2016-08-08 11:15 [PATCH 1/3] i18n: setup: mark error messages for translation Vasco Almeida
  2016-08-08 11:16 ` [PATCH 2/3] i18n: archive: mark errors " Vasco Almeida
  2016-08-08 11:16 ` [PATCH 3/3] i18n: git-stash: mark message " Vasco Almeida
@ 2016-08-10 10:50 ` Vasco Almeida
  2016-08-10 10:50   ` [PATCH v2 2/3] i18n: archive: mark errors " Vasco Almeida
  2016-08-10 10:50   ` [PATCH v2 3/3] i18n: git-stash: mark messages " Vasco Almeida
  2 siblings, 2 replies; 9+ messages in thread
From: Vasco Almeida @ 2016-08-10 10:50 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Ævar Arnfjörð Bjarmason,
	Junio C Hamano

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 setup.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/setup.c b/setup.c
index 6d0e0c9..fe572b8 100644
--- a/setup.c
+++ b/setup.c
@@ -759,9 +759,9 @@ static const char *setup_bare_git_dir(struct strbuf *cwd, int offset,
 static const char *setup_nongit(const char *cwd, int *nongit_ok)
 {
 	if (!nongit_ok)
-		die("Not a git repository (or any of the parent directories): %s", DEFAULT_GIT_DIR_ENVIRONMENT);
+		die(_("Not a git repository (or any of the parent directories): %s"), DEFAULT_GIT_DIR_ENVIRONMENT);
 	if (chdir(cwd))
-		die_errno("Cannot come back to cwd");
+		die_errno(_("Cannot come back to cwd"));
 	*nongit_ok = 1;
 	return NULL;
 }
@@ -842,7 +842,7 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)
 		*nongit_ok = 0;
 
 	if (strbuf_getcwd(&cwd))
-		die_errno("Unable to read current working directory");
+		die_errno(_("Unable to read current working directory"));
 	offset = cwd.len;
 
 	/*
@@ -912,19 +912,19 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)
 			if (parent_device != current_device) {
 				if (nongit_ok) {
 					if (chdir(cwd.buf))
-						die_errno("Cannot come back to cwd");
+						die_errno(_("Cannot come back to cwd"));
 					*nongit_ok = 1;
 					return NULL;
 				}
 				strbuf_setlen(&cwd, offset);
-				die("Not a git repository (or any parent up to mount point %s)\n"
-				"Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).",
+				die(_("Not a git repository (or any parent up to mount point %s)\n"
+				"Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)."),
 				    cwd.buf);
 			}
 		}
 		if (chdir("..")) {
 			strbuf_setlen(&cwd, offset);
-			die_errno("Cannot change to '%s/..'", cwd.buf);
+			die_errno(_("Cannot change to '%s/..'"), cwd.buf);
 		}
 		offset = offset_parent;
 	}
@@ -986,9 +986,9 @@ int git_config_perm(const char *var, const char *value)
 	/* A filemode value was given: 0xxx */
 
 	if ((i & 0600) != 0600)
-		die("Problem with core.sharedRepository filemode value "
+		die(_("Problem with core.sharedRepository filemode value "
 		    "(0%.3o).\nThe owner of files must always have "
-		    "read and write permissions.", i);
+		    "read and write permissions."), i);
 
 	/*
 	 * Mask filemode value. Others can not get write permission.
-- 
2.7.4


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

* [PATCH v2 2/3] i18n: archive: mark errors for translation
  2016-08-10 10:50 ` [PATCH v2 1/3] i18n: setup: mark error messages " Vasco Almeida
@ 2016-08-10 10:50   ` Vasco Almeida
  2016-08-10 10:50   ` [PATCH v2 3/3] i18n: git-stash: mark messages " Vasco Almeida
  1 sibling, 0 replies; 9+ messages in thread
From: Vasco Almeida @ 2016-08-10 10:50 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Ævar Arnfjörð Bjarmason,
	Junio C Hamano

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 archive.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/archive.c b/archive.c
index 42df974..dde1ab4 100644
--- a/archive.c
+++ b/archive.c
@@ -458,11 +458,11 @@ static int parse_archive_args(int argc, const char **argv,
 	argc = parse_options(argc, argv, NULL, opts, archive_usage, 0);
 
 	if (remote)
-		die("Unexpected option --remote");
+		die(_("Unexpected option --remote"));
 	if (exec)
-		die("Option --exec can only be used together with --remote");
+		die(_("Option --exec can only be used together with --remote"));
 	if (output)
-		die("Unexpected option --output");
+		die(_("Unexpected option --output"));
 
 	if (!base)
 		base = "";
@@ -484,14 +484,14 @@ static int parse_archive_args(int argc, const char **argv,
 		usage_with_options(archive_usage, opts);
 	*ar = lookup_archiver(format);
 	if (!*ar || (is_remote && !((*ar)->flags & ARCHIVER_REMOTE)))
-		die("Unknown archive format '%s'", format);
+		die(_("Unknown archive format '%s'"), format);
 
 	args->compression_level = Z_DEFAULT_COMPRESSION;
 	if (compression_level != -1) {
 		if ((*ar)->flags & ARCHIVER_WANT_COMPRESSION_LEVELS)
 			args->compression_level = compression_level;
 		else {
-			die("Argument not supported for format '%s': -%d",
+			die(_("Argument not supported for format '%s': -%d"),
 					format, compression_level);
 		}
 	}
-- 
2.7.4


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

* [PATCH v2 3/3] i18n: git-stash: mark messages for translation
  2016-08-10 10:50 ` [PATCH v2 1/3] i18n: setup: mark error messages " Vasco Almeida
  2016-08-10 10:50   ` [PATCH v2 2/3] i18n: archive: mark errors " Vasco Almeida
@ 2016-08-10 10:50   ` Vasco Almeida
  1 sibling, 0 replies; 9+ messages in thread
From: Vasco Almeida @ 2016-08-10 10:50 UTC (permalink / raw)
  To: git; +Cc: Vasco Almeida, Ævar Arnfjörð Bjarmason,
	Junio C Hamano

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---

I added the second mark that I had missed the first time.
Thank you Junio C Hamano for spotting that.

 git-stash.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-stash.sh b/git-stash.sh
index 22fb8bc..826af18 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -265,7 +265,7 @@ save_stash () {
 	create_stash "$stash_msg" $untracked
 	store_stash -m "$stash_msg" -q $w_commit ||
 	die "$(gettext "Cannot save the current status")"
-	say Saved working directory and index state "$stash_msg"
+	say "$(eval_gettext "Saved working directory and index state \$stash_msg")"
 
 	if test -z "$patch_mode"
 	then
@@ -548,7 +548,7 @@ pop_stash() {
 		drop_stash "$@"
 	else
 		status=$?
-		say "The stash is kept in case you need it again."
+		say "$(gettext "The stash is kept in case you need it again.")"
 		exit $status
 	fi
 }
-- 
2.7.4


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

* Re: [PATCH 2/3] i18n: archive: mark errors for translation
  2016-08-09 19:35   ` Junio C Hamano
@ 2016-08-10 13:28     ` Vasco Almeida
  0 siblings, 0 replies; 9+ messages in thread
From: Vasco Almeida @ 2016-08-10 13:28 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Ævar Arnfjörð Bjarmason

A Ter, 09-08-2016 às 12:35 -0700, Junio C Hamano escreveu:
> Hmm, this function is called by write_archive(), which can be called
> by the upload-archive process running on the remote end, whose
> locale certainly is different from that of your local environment.
> 
> If I do not read English and got one of these messages from the
> remote end, I can copy that into a search engine to read more about
> the error, but if I got it translated into, say, Portuguese, I'd
> have a (slightly) harder time dealing with the error, I would think.
> 
> Having said that, I expect that sites that expect internatinal
> audience to come would run these services in C locale, and other
> sites that target audiences in a single locale would choose to use
> their favourite single locale, so probably we do not have to worry
> about it.

I don't know what is the best. I trust you to decide. I'm happy with
whatever you decide.

When I marked those string I did not noticed what you did, just spot
the string and marked them. So I submitted this without taking that
into consideration.

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

end of thread, other threads:[~2016-08-10 19:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-08 11:15 [PATCH 1/3] i18n: setup: mark error messages for translation Vasco Almeida
2016-08-08 11:16 ` [PATCH 2/3] i18n: archive: mark errors " Vasco Almeida
2016-08-09 19:35   ` Junio C Hamano
2016-08-10 13:28     ` Vasco Almeida
2016-08-08 11:16 ` [PATCH 3/3] i18n: git-stash: mark message " Vasco Almeida
2016-08-09 19:36   ` Junio C Hamano
2016-08-10 10:50 ` [PATCH v2 1/3] i18n: setup: mark error messages " Vasco Almeida
2016-08-10 10:50   ` [PATCH v2 2/3] i18n: archive: mark errors " Vasco Almeida
2016-08-10 10:50   ` [PATCH v2 3/3] i18n: git-stash: mark messages " Vasco Almeida

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