{"thread":{"id":"39264","subject":"[PATCH] Fixed translation error in config.c file","startedAt":"2015-05-06T20:51:07Z","lastAt":"2015-05-07T16:28:52Z","messageCount":6,"participants":["Alangi Derick","Junio C Hamano","Thiago Farina","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"260695","messageId":"554a8472.8c3bc20a.458e.ffffdae7@mx.google.com","threadId":"39264","inReplyTo":null,"subject":"[PATCH] Fixed translation error in config.c file","fromName":"Alangi Derick","fromEmail":"alangiderick@gmail.com","sentAt":"2015-05-06T20:51:07Z","receivedAt":"2015-05-06T20:51:07Z","isPatch":true,"sender":{"key":"alangiderick@gmail.com","avatar":"https://gravatar.com/avatar/f5878e69e83b4cf7ed499336c4a114dc2cb253253bc57c9b8ffcf0e129320795?d=mp&s=160"},"body":"There was an existing translation in 'git config' output, that was incorrect in some unspecified way, and this change corrects that breakage\n\nSigned-off-by: Alangi Derick <alangiderick@gmail.com>\n---\n builtin/config.c | 38 +++++++++++++++++++-------------------\n 1 file changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/builtin/config.c b/builtin/config.c\nindex bfd3016..47c1a42 100644\n--- a/builtin/config.c\n+++ b/builtin/config.c\n@@ -85,7 +85,7 @@ static struct option builtin_config_options[] = {\n static void check_argc(int argc, int min, int max) {\n \tif (argc >= min && argc <= max)\n \t\treturn;\n-\terror(\"wrong number of arguments\");\n+\terror(_(\"wrong number of arguments\"));\n \tusage_with_options(builtin_config_usage, builtin_config_options);\n }\n \n@@ -193,7 +193,7 @@ static int get_value(const char *key_, const char *regex_)\n \n \t\tkey_regexp = (regex_t*)xmalloc(sizeof(regex_t));\n \t\tif (regcomp(key_regexp, key, REG_EXTENDED)) {\n-\t\t\tfprintf(stderr, \"Invalid key pattern: %s\\n\", key_);\n+\t\t\terror(_(\"Invalid key pattern: %s\\n\"), key_);\n \t\t\tfree(key_regexp);\n \t\t\tkey_regexp = NULL;\n \t\t\tret = CONFIG_INVALID_PATTERN;\n@@ -214,7 +214,7 @@ static int get_value(const char *key_, const char *regex_)\n \n \t\tregexp = (regex_t*)xmalloc(sizeof(regex_t));\n \t\tif (regcomp(regexp, regex_, REG_EXTENDED)) {\n-\t\t\tfprintf(stderr, \"Invalid pattern: %s\\n\", regex_);\n+\t\t\terror(_(\"Invalid pattern: %s\\n\"), regex_);\n \t\t\tfree(regexp);\n \t\t\tregexp = NULL;\n \t\t\tret = CONFIG_INVALID_PATTERN;\n@@ -366,10 +366,10 @@ static int get_colorbool(const char *var, int print)\n static void check_write(void)\n {\n \tif (given_config_source.use_stdin)\n-\t\tdie(\"writing to stdin is not supported\");\n+\t\tdie(_(\"writing to stdin is not supported\"));\n \n \tif (given_config_source.blob)\n-\t\tdie(\"writing config blobs is not supported\");\n+\t\tdie(_(\"writing config blobs is not supported\"));\n }\n \n struct urlmatch_current_candidate_value {\n@@ -477,7 +477,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \n \tif (use_global_config + use_system_config + use_local_config +\n \t    !!given_config_source.file + !!given_config_source.blob > 1) {\n-\t\terror(\"only one config file at a time.\");\n+\t\terror(_(\"only one config file at a time.\"));\n \t\tusage_with_options(builtin_config_usage, builtin_config_options);\n \t}\n \n@@ -500,7 +500,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\t\t * location; error out even if XDG_CONFIG_HOME\n \t\t\t * is set and points at a sane location.\n \t\t\t */\n-\t\t\tdie(\"$HOME not set\");\n+\t\t\tdie(_(\"$HOME not set\"));\n \n \t\tif (access_or_warn(user_config, R_OK, 0) &&\n \t\t    xdg_config && !access_or_warn(xdg_config, R_OK, 0))\n@@ -530,17 +530,17 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (HAS_MULTI_BITS(types)) {\n-\t\terror(\"only one type at a time.\");\n+\t\terror(_(\"only one type at a time.\"));\n \t\tusage_with_options(builtin_config_usage, builtin_config_options);\n \t}\n \n \tif ((actions & (ACTION_GET_COLOR|ACTION_GET_COLORBOOL)) && types) {\n-\t\terror(\"--get-color and variable type are incoherent\");\n+\t\terror(_(\"--get-color and variable type are incoherent\"));\n \t\tusage_with_options(builtin_config_usage, builtin_config_options);\n \t}\n \n \tif (HAS_MULTI_BITS(actions)) {\n-\t\terror(\"only one action at a time.\");\n+\t\terror(_(\"only one action at a time.\"));\n \t\tusage_with_options(builtin_config_usage, builtin_config_options);\n \t}\n \tif (actions == 0)\n@@ -558,10 +558,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\t\t\t\t    &given_config_source,\n \t\t\t\t\t    respect_includes) < 0) {\n \t\t\tif (given_config_source.file)\n-\t\t\t\tdie_errno(\"unable to read config file '%s'\",\n+\t\t\t\tdie_errno(_(\"unable to read config file '%s'\"),\n \t\t\t\t\t  given_config_source.file);\n \t\t\telse\n-\t\t\t\tdie(\"error processing config file(s)\");\n+\t\t\t\tdie(_(\"error processing config file(s)\"));\n \t\t}\n \t}\n \telse if (actions == ACTION_EDIT) {\n@@ -569,11 +569,11 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \n \t\tcheck_argc(argc, 0, 0);\n \t\tif (!given_config_source.file && nongit)\n-\t\t\tdie(\"not in a git directory\");\n+\t\t\tdie(_(\"not in a git directory\"));\n \t\tif (given_config_source.use_stdin)\n-\t\t\tdie(\"editing stdin is not supported\");\n+\t\t\tdie(_(\"editing stdin is not supported\"));\n \t\tif (given_config_source.blob)\n-\t\t\tdie(\"editing blobs is not supported\");\n+\t\t\tdie(_(\"editing blobs is not supported\"));\n \t\tgit_config(git_default_config, NULL);\n \t\tconfig_file = xstrdup(given_config_source.file ?\n \t\t\t\t      given_config_source.file : git_path(\"config\"));\n@@ -598,8 +598,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\tvalue = normalize_value(argv[0], argv[1]);\n \t\tret = git_config_set_in_file(given_config_source.file, argv[0], value);\n \t\tif (ret == CONFIG_NOTHING_SET)\n-\t\t\terror(\"cannot overwrite multiple values with a single value\\n\"\n-\t\t\t\"       Use a regexp, --add or --replace-all to change %s.\", argv[0]);\n+\t\t\terror(_(\"cannot overwrite multiple values with a single value\\n\"\n+\t\t\t\"       Use a regexp, --add or --replace-all to change %s.\"), argv[0]);\n \t\treturn ret;\n \t}\n \telse if (actions == ACTION_SET_ALL) {\n@@ -669,7 +669,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\tif (ret < 0)\n \t\t\treturn ret;\n \t\tif (ret == 0)\n-\t\t\tdie(\"No such section!\");\n+\t\t\tdie(_(\"No such section!\"));\n \t}\n \telse if (actions == ACTION_REMOVE_SECTION) {\n \t\tint ret;\n@@ -680,7 +680,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\tif (ret < 0)\n \t\t\treturn ret;\n \t\tif (ret == 0)\n-\t\t\tdie(\"No such section!\");\n+\t\t\tdie(_(\"No such section!\"));\n \t}\n \telse if (actions == ACTION_GET_COLOR) {\n \t\tcheck_argc(argc, 1, 2);\n-- \n2.4.0.dirty\n"},{"id":"260696","messageId":"xmqqpp6ds5jh.fsf@gitster.dls.corp.google.com","threadId":"39264","inReplyTo":"554a8472.8c3bc20a.458e.ffffdae7@mx.google.com","subject":"Re: [PATCH] Fixed translation error in config.c file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-06T22:30:10Z","receivedAt":"2015-05-06T22:30:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\n>> Cc: unlisted-recipients:; (no To-header on input)\n\nNot again X-<.\n\nYou are sending this to a single recipient which is the mailing\nlist.  Send it \"To: git@vger.kernel.org\".\n\n>> Subject: Re: [PATCH] Fixed translation error in config.c file\n\nEhh, how many times do I have to say this is *not* \"fixing\ntranslation errors\"?\n\nmaintainer starts wondering if he is deliberately being ignored, and\nstops reading...\n"},{"id":"260723","messageId":"CAKB+oNtkKQ+za8VkO0B9m0K=UqNoOSn_+zwZeFW_aOiV7Wk5aQ@mail.gmail.com","threadId":"39264","inReplyTo":"xmqqpp6ds5jh.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] Fixed translation error in config.c file","fromName":"Alangi Derick","fromEmail":"alangiderick@gmail.com","sentAt":"2015-05-07T11:36:56Z","receivedAt":"2015-05-07T11:36:56Z","isPatch":true,"sender":{"key":"alangiderick@gmail.com","avatar":"https://gravatar.com/avatar/f5878e69e83b4cf7ed499336c4a114dc2cb253253bc57c9b8ffcf0e129320795?d=mp&s=160"},"body":"So what should the Title be? Please i am learning this community so i\nhave to make a lot of mistakes. Pardon me.\nRegards\nAlangi Derick Ndimnain\n\n\nOn Wed, May 6, 2015 at 11:30 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n>>> Cc: unlisted-recipients:; (no To-header on input)\n>\n> Not again X-<.\n>\n> You are sending this to a single recipient which is the mailing\n> list.  Send it \"To: git@vger.kernel.org\".\n>\n>>> Subject: Re: [PATCH] Fixed translation error in config.c file\n>\n> Ehh, how many times do I have to say this is *not* \"fixing\n> translation errors\"?\n>\n> maintainer starts wondering if he is deliberately being ignored, and\n> stops reading...\n>\n>\n>\n"},{"id":"260724","messageId":"CACnwZYd-hhS2w33rsQ9xR__gdnCUC8ni2ot=KqViWLNjnWFhjQ@mail.gmail.com","threadId":"39264","inReplyTo":"CAKB+oNtkKQ+za8VkO0B9m0K=UqNoOSn_+zwZeFW_aOiV7Wk5aQ@mail.gmail.com","subject":"Re: [PATCH] Fixed translation error in config.c file","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2015-05-07T13:39:30Z","receivedAt":"2015-05-07T13:39:30Z","isPatch":true,"sender":{"key":"tfransosi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/970071?v=4"},"body":"On Thu, May 7, 2015 at 8:36 AM, Alangi Derick <alangiderick@gmail.com> wrote:\n> So what should the Title be? Please i am learning this community so i\n> have to make a lot of mistakes. Pardon me.\nAllow me to say something? Forgive me if it sounds rude, as it might sound.\n\nGit community is highly technical and is about developing and\nimproving Git scm tool.\n\nTo be honest, I think it is not a place to learn C or how to\ncontribute to open source projects.\nThere are better places for this (you can set up your own projects in\nGitHub for example).\n\nSo while you can do a lot of mistakes and learn from them, this causes\nnoise and waste of time,\nsince Junio has to look at your patch, and he lost time if he has to\nexplain over and over the\nprocedures of how to format and send a good patch.\n\nJust curious, is this your first contact with the C language (a new\nclass at the University)?\n\n-- \nThiago Farina\n"},{"id":"260725","messageId":"xmqqlhh0scz5.fsf@gitster.dls.corp.google.com","threadId":"39264","inReplyTo":"CACnwZYd-hhS2w33rsQ9xR__gdnCUC8ni2ot=KqViWLNjnWFhjQ@mail.gmail.com","subject":"Re: [PATCH] Fixed translation error in config.c file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-07T14:01:50Z","receivedAt":"2015-05-07T14:01:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thiago Farina <tfransosi@gmail.com> writes:\n\n> On Thu, May 7, 2015 at 8:36 AM, Alangi Derick <alangiderick@gmail.com> wrote:\n>> So what should the Title be? Please i am learning this community so i\n>> have to make a lot of mistakes. Pardon me.\n> Allow me to say something? Forgive me if it sounds rude, as it might sound.\n>\n> Git community is highly technical and is about developing and\n> improving Git scm tool.\n>\n> To be honest, I think it is not a place to learn C or how to\n> contribute to open source projects.\n\nFWIW, I do not mind explaining things to new people. Teaching new\npeople is how you grow the community.\n\nI however have finite time budget for that kind of activity, and it\nannoys me when I see that an earlier suggestion was apparently not\nread, and a question is asked when its answer is already in the\nmailbox of who is asking it, e.g.\n\n  http://article.gmane.org/gmane.comp.version-control.git/268484\n\nin which I had to repeat what I said in:\n\n  http://article.gmane.org/gmane.comp.version-control.git/268335\n"},{"id":"260738","messageId":"CAPig+cSNj2_JVH=nU=pSkHmdW_Yvd0aLC8Hk5we9r=mduKDj=g@mail.gmail.com","threadId":"39264","inReplyTo":"554a8472.8c3bc20a.458e.ffffdae7@mx.google.com","subject":"Re: [PATCH] Fixed translation error in config.c file","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-05-07T16:28:52Z","receivedAt":"2015-05-07T16:28:52Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, May 6, 2015 at 4:51 PM, Alangi Derick <alangiderick@gmail.com> wrote:\n> There was an existing translation in 'git config' output, that was\n> incorrect in some unspecified way, and this change corrects that\n> breakage\n>\n> Signed-off-by: Alangi Derick <alangiderick@gmail.com>\n> ---\n> diff --git a/builtin/config.c b/builtin/config.c\n> index bfd3016..47c1a42 100644\n> --- a/builtin/config.c\n> +++ b/builtin/config.c\n> @@ -193,7 +193,7 @@ static int get_value(const char *key_, const char *regex_)\n>\n>                 key_regexp = (regex_t*)xmalloc(sizeof(regex_t));\n>                 if (regcomp(key_regexp, key, REG_EXTENDED)) {\n> -                       fprintf(stderr, \"Invalid key pattern: %s\\n\", key_);\n> +                       error(_(\"Invalid key pattern: %s\\n\"), key_);\n\nA couple comments:\n\nAs a convenience, error() automatically outputs a newline (\\n) after\nthe message, therefore, when you convert this from fprintf() to\nerror(), you will need to remove the '\\n' from the string.\n\nChanging fprintf() calls to error() is a very distinct change from\nmarking strings for translation by wrapping them with _(...),\ntherefore the fprintf()-to-error() change should be done separately in\nits own patch. (And, that patch should only change fprintf() to\nerror(); it should not do the _(...) wrapping.)\n\n>                         free(key_regexp);\n>                         key_regexp = NULL;\n>                         ret = CONFIG_INVALID_PATTERN;\n"}]}