All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fixed translation error in config.c file
@ 2015-05-06 20:51 Alangi Derick
  2015-05-06 22:30 ` Junio C Hamano
  2015-05-07 16:28 ` Eric Sunshine
  0 siblings, 2 replies; 6+ messages in thread
From: Alangi Derick @ 2015-05-06 20:51 UTC (permalink / raw)


There was an existing translation in 'git config' output, that was incorrect in some unspecified way, and this change corrects that breakage

Signed-off-by: Alangi Derick <alangiderick@gmail.com>
---
 builtin/config.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/builtin/config.c b/builtin/config.c
index bfd3016..47c1a42 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -85,7 +85,7 @@ static struct option builtin_config_options[] = {
 static void check_argc(int argc, int min, int max) {
 	if (argc >= min && argc <= max)
 		return;
-	error("wrong number of arguments");
+	error(_("wrong number of arguments"));
 	usage_with_options(builtin_config_usage, builtin_config_options);
 }
 
@@ -193,7 +193,7 @@ static int get_value(const char *key_, const char *regex_)
 
 		key_regexp = (regex_t*)xmalloc(sizeof(regex_t));
 		if (regcomp(key_regexp, key, REG_EXTENDED)) {
-			fprintf(stderr, "Invalid key pattern: %s\n", key_);
+			error(_("Invalid key pattern: %s\n"), key_);
 			free(key_regexp);
 			key_regexp = NULL;
 			ret = CONFIG_INVALID_PATTERN;
@@ -214,7 +214,7 @@ static int get_value(const char *key_, const char *regex_)
 
 		regexp = (regex_t*)xmalloc(sizeof(regex_t));
 		if (regcomp(regexp, regex_, REG_EXTENDED)) {
-			fprintf(stderr, "Invalid pattern: %s\n", regex_);
+			error(_("Invalid pattern: %s\n"), regex_);
 			free(regexp);
 			regexp = NULL;
 			ret = CONFIG_INVALID_PATTERN;
@@ -366,10 +366,10 @@ static int get_colorbool(const char *var, int print)
 static void check_write(void)
 {
 	if (given_config_source.use_stdin)
-		die("writing to stdin is not supported");
+		die(_("writing to stdin is not supported"));
 
 	if (given_config_source.blob)
-		die("writing config blobs is not supported");
+		die(_("writing config blobs is not supported"));
 }
 
 struct urlmatch_current_candidate_value {
@@ -477,7 +477,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 
 	if (use_global_config + use_system_config + use_local_config +
 	    !!given_config_source.file + !!given_config_source.blob > 1) {
-		error("only one config file at a time.");
+		error(_("only one config file at a time."));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 
@@ -500,7 +500,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 			 * location; error out even if XDG_CONFIG_HOME
 			 * is set and points at a sane location.
 			 */
-			die("$HOME not set");
+			die(_("$HOME not set"));
 
 		if (access_or_warn(user_config, R_OK, 0) &&
 		    xdg_config && !access_or_warn(xdg_config, R_OK, 0))
@@ -530,17 +530,17 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 	}
 
 	if (HAS_MULTI_BITS(types)) {
-		error("only one type at a time.");
+		error(_("only one type at a time."));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 
 	if ((actions & (ACTION_GET_COLOR|ACTION_GET_COLORBOOL)) && types) {
-		error("--get-color and variable type are incoherent");
+		error(_("--get-color and variable type are incoherent"));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 
 	if (HAS_MULTI_BITS(actions)) {
-		error("only one action at a time.");
+		error(_("only one action at a time."));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 	if (actions == 0)
@@ -558,10 +558,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 					    &given_config_source,
 					    respect_includes) < 0) {
 			if (given_config_source.file)
-				die_errno("unable to read config file '%s'",
+				die_errno(_("unable to read config file '%s'"),
 					  given_config_source.file);
 			else
-				die("error processing config file(s)");
+				die(_("error processing config file(s)"));
 		}
 	}
 	else if (actions == ACTION_EDIT) {
@@ -569,11 +569,11 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 
 		check_argc(argc, 0, 0);
 		if (!given_config_source.file && nongit)
-			die("not in a git directory");
+			die(_("not in a git directory"));
 		if (given_config_source.use_stdin)
-			die("editing stdin is not supported");
+			die(_("editing stdin is not supported"));
 		if (given_config_source.blob)
-			die("editing blobs is not supported");
+			die(_("editing blobs is not supported"));
 		git_config(git_default_config, NULL);
 		config_file = xstrdup(given_config_source.file ?
 				      given_config_source.file : git_path("config"));
@@ -598,8 +598,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		value = normalize_value(argv[0], argv[1]);
 		ret = git_config_set_in_file(given_config_source.file, argv[0], value);
 		if (ret == CONFIG_NOTHING_SET)
-			error("cannot overwrite multiple values with a single value\n"
-			"       Use a regexp, --add or --replace-all to change %s.", argv[0]);
+			error(_("cannot overwrite multiple values with a single value\n"
+			"       Use a regexp, --add or --replace-all to change %s."), argv[0]);
 		return ret;
 	}
 	else if (actions == ACTION_SET_ALL) {
@@ -669,7 +669,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		if (ret < 0)
 			return ret;
 		if (ret == 0)
-			die("No such section!");
+			die(_("No such section!"));
 	}
 	else if (actions == ACTION_REMOVE_SECTION) {
 		int ret;
@@ -680,7 +680,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		if (ret < 0)
 			return ret;
 		if (ret == 0)
-			die("No such section!");
+			die(_("No such section!"));
 	}
 	else if (actions == ACTION_GET_COLOR) {
 		check_argc(argc, 1, 2);
-- 
2.4.0.dirty

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

* Re: [PATCH] Fixed translation error in config.c file
  2015-05-06 20:51 [PATCH] Fixed translation error in config.c file Alangi Derick
@ 2015-05-06 22:30 ` Junio C Hamano
  2015-05-07 11:36   ` Alangi Derick
  2015-05-07 16:28 ` Eric Sunshine
  1 sibling, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2015-05-06 22:30 UTC (permalink / raw)
  To: Alangi Derick; +Cc: git


>> Cc: unlisted-recipients:; (no To-header on input)

Not again X-<.

You are sending this to a single recipient which is the mailing
list.  Send it "To: git@vger.kernel.org".

>> Subject: Re: [PATCH] Fixed translation error in config.c file

Ehh, how many times do I have to say this is *not* "fixing
translation errors"?

maintainer starts wondering if he is deliberately being ignored, and
stops reading...

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

* Re: [PATCH] Fixed translation error in config.c file
  2015-05-06 22:30 ` Junio C Hamano
@ 2015-05-07 11:36   ` Alangi Derick
  2015-05-07 13:39     ` Thiago Farina
  0 siblings, 1 reply; 6+ messages in thread
From: Alangi Derick @ 2015-05-07 11:36 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

So what should the Title be? Please i am learning this community so i
have to make a lot of mistakes. Pardon me.
Regards
Alangi Derick Ndimnain


On Wed, May 6, 2015 at 11:30 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
>>> Cc: unlisted-recipients:; (no To-header on input)
>
> Not again X-<.
>
> You are sending this to a single recipient which is the mailing
> list.  Send it "To: git@vger.kernel.org".
>
>>> Subject: Re: [PATCH] Fixed translation error in config.c file
>
> Ehh, how many times do I have to say this is *not* "fixing
> translation errors"?
>
> maintainer starts wondering if he is deliberately being ignored, and
> stops reading...
>
>
>

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

* Re: [PATCH] Fixed translation error in config.c file
  2015-05-07 11:36   ` Alangi Derick
@ 2015-05-07 13:39     ` Thiago Farina
  2015-05-07 14:01       ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Thiago Farina @ 2015-05-07 13:39 UTC (permalink / raw)
  To: Alangi Derick; +Cc: Junio C Hamano, Git Mailing List

On Thu, May 7, 2015 at 8:36 AM, Alangi Derick <alangiderick@gmail.com> wrote:
> So what should the Title be? Please i am learning this community so i
> have to make a lot of mistakes. Pardon me.
Allow me to say something? Forgive me if it sounds rude, as it might sound.

Git community is highly technical and is about developing and
improving Git scm tool.

To be honest, I think it is not a place to learn C or how to
contribute to open source projects.
There are better places for this (you can set up your own projects in
GitHub for example).

So while you can do a lot of mistakes and learn from them, this causes
noise and waste of time,
since Junio has to look at your patch, and he lost time if he has to
explain over and over the
procedures of how to format and send a good patch.

Just curious, is this your first contact with the C language (a new
class at the University)?

-- 
Thiago Farina

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

* Re: [PATCH] Fixed translation error in config.c file
  2015-05-07 13:39     ` Thiago Farina
@ 2015-05-07 14:01       ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2015-05-07 14:01 UTC (permalink / raw)
  To: Thiago Farina; +Cc: Alangi Derick, Git Mailing List

Thiago Farina <tfransosi@gmail.com> writes:

> On Thu, May 7, 2015 at 8:36 AM, Alangi Derick <alangiderick@gmail.com> wrote:
>> So what should the Title be? Please i am learning this community so i
>> have to make a lot of mistakes. Pardon me.
> Allow me to say something? Forgive me if it sounds rude, as it might sound.
>
> Git community is highly technical and is about developing and
> improving Git scm tool.
>
> To be honest, I think it is not a place to learn C or how to
> contribute to open source projects.

FWIW, I do not mind explaining things to new people. Teaching new
people is how you grow the community.

I however have finite time budget for that kind of activity, and it
annoys me when I see that an earlier suggestion was apparently not
read, and a question is asked when its answer is already in the
mailbox of who is asking it, e.g.

  http://article.gmane.org/gmane.comp.version-control.git/268484

in which I had to repeat what I said in:

  http://article.gmane.org/gmane.comp.version-control.git/268335

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

* Re: [PATCH] Fixed translation error in config.c file
  2015-05-06 20:51 [PATCH] Fixed translation error in config.c file Alangi Derick
  2015-05-06 22:30 ` Junio C Hamano
@ 2015-05-07 16:28 ` Eric Sunshine
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Sunshine @ 2015-05-07 16:28 UTC (permalink / raw)
  To: Alangi Derick, Git List

On Wed, May 6, 2015 at 4:51 PM, Alangi Derick <alangiderick@gmail.com> wrote:
> There was an existing translation in 'git config' output, that was
> incorrect in some unspecified way, and this change corrects that
> breakage
>
> Signed-off-by: Alangi Derick <alangiderick@gmail.com>
> ---
> diff --git a/builtin/config.c b/builtin/config.c
> index bfd3016..47c1a42 100644
> --- a/builtin/config.c
> +++ b/builtin/config.c
> @@ -193,7 +193,7 @@ static int get_value(const char *key_, const char *regex_)
>
>                 key_regexp = (regex_t*)xmalloc(sizeof(regex_t));
>                 if (regcomp(key_regexp, key, REG_EXTENDED)) {
> -                       fprintf(stderr, "Invalid key pattern: %s\n", key_);
> +                       error(_("Invalid key pattern: %s\n"), key_);

A couple comments:

As a convenience, error() automatically outputs a newline (\n) after
the message, therefore, when you convert this from fprintf() to
error(), you will need to remove the '\n' from the string.

Changing fprintf() calls to error() is a very distinct change from
marking strings for translation by wrapping them with _(...),
therefore the fprintf()-to-error() change should be done separately in
its own patch. (And, that patch should only change fprintf() to
error(); it should not do the _(...) wrapping.)

>                         free(key_regexp);
>                         key_regexp = NULL;
>                         ret = CONFIG_INVALID_PATTERN;

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

end of thread, other threads:[~2015-05-07 16:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-06 20:51 [PATCH] Fixed translation error in config.c file Alangi Derick
2015-05-06 22:30 ` Junio C Hamano
2015-05-07 11:36   ` Alangi Derick
2015-05-07 13:39     ` Thiago Farina
2015-05-07 14:01       ` Junio C Hamano
2015-05-07 16:28 ` Eric Sunshine

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.