git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 7, 2015, 16:28 UTC
Message-ID
<CAPig+cSNj2_JVH=nU=pSkHmdW_Yvd0aLC8Hk5we9r=mduKDj=g@mail.gmail.com>
In-Reply-To
<554a8472.8c3bc20a.458e.ffffdae7@mx.google.com>
On Wed, May 6, 2015 at 4:51 PM, Alangi Derick <alangiderick@gmail.com> wrote:
Show 16 quoted lines
> 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;
Previous: Junio C Hamano
Message 6 of 6 in “Fixed translation error in config.c file”
  1. Fixed translation error in config.c fileAlangi Derick, May 6, 2015
  2. Junio C HamanoMay 6, 2015
  3. Alangi DerickMay 7, 2015
  4. Thiago FarinaMay 7, 2015
  5. Junio C HamanoMay 7, 2015
  6. Eric SunshineMay 7, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.