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

Re: [PATCH] i18n: remove i18n from tag reflog message

From
Junio C Hamano <gitster@pobox.com>
Date
May 1, 2017, 01:45 UTC
Message-ID
<xmqqwpa1ic4e.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170429100253.4710-1-jn.avila@free.fr>
Jean-Noel Avila <jn.avila@free.fr> writes:
> The building of the reflog message is using strbuf, which is not
> friendly with internationalization frameworks. No other reflog
> messages are translated right now and switching all the messages to
> i18n would require a major rework of the way the messages are built.

Thanks for spotting. Before we declare that reflog messages are for i18n, we'd need to either drop (or redesign the implementation of) the "checkout -" feature, which relies on the exact phrasing of how reflog entries from "git checkout" looks like.

Will queue and merge down to 'master' quickly.
Show 53 quoted lines
>
> Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
> ---
>  builtin/tag.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/builtin/tag.c b/builtin/tag.c
> index 222404522..bdf1e88e9 100644
> --- a/builtin/tag.c
> +++ b/builtin/tag.c
> @@ -309,7 +309,7 @@ static void create_reflog_msg(const unsigned char *sha1, struct strbuf *sb)
>  	if (rla) {
>  		strbuf_addstr(sb, rla);
>  	} else {
> -		strbuf_addstr(sb, _("tag: tagging "));
> +		strbuf_addstr(sb, "tag: tagging ");
>  		strbuf_add_unique_abbrev(sb, sha1, DEFAULT_ABBREV);
>  	}
>  
> @@ -317,14 +317,14 @@ static void create_reflog_msg(const unsigned char *sha1, struct strbuf *sb)
>  	type = sha1_object_info(sha1, NULL);
>  	switch (type) {
>  	default:
> -		strbuf_addstr(sb, _("object of unknown type"));
> +		strbuf_addstr(sb, "object of unknown type");
>  		break;
>  	case OBJ_COMMIT:
>  		if ((buf = read_sha1_file(sha1, &type, &size)) != NULL) {
>  			subject_len = find_commit_subject(buf, &subject_start);
>  			strbuf_insert(sb, sb->len, subject_start, subject_len);
>  		} else {
> -			strbuf_addstr(sb, _("commit object"));
> +			strbuf_addstr(sb, "commit object");
>  		}
>  		free(buf);
>  
> @@ -332,13 +332,13 @@ static void create_reflog_msg(const unsigned char *sha1, struct strbuf *sb)
>  			strbuf_addf(sb, ", %s", show_date(c->date, 0, DATE_MODE(SHORT)));
>  		break;
>  	case OBJ_TREE:
> -		strbuf_addstr(sb, _("tree object"));
> +		strbuf_addstr(sb, "tree object");
>  		break;
>  	case OBJ_BLOB:
> -		strbuf_addstr(sb, _("blob object"));
> +		strbuf_addstr(sb, "blob object");
>  		break;
>  	case OBJ_TAG:
> -		strbuf_addstr(sb, _("other tag object"));
> +		strbuf_addstr(sb, "other tag object");
>  		break;
>  	}
>  	strbuf_addch(sb, ')');
Previous: Jean-Noel AvilaNext: Jean-Noël AVILA
Message 5 of 9 in “i18n: remove i18n from tag reflog message”
  1. i18n: remove i18n from tag reflog messageJean-Noel Avila, Apr 29, 2017
  2. i18n patches to apply for rc2Jean-Noel Avila, Apr 30, 2017
  3. 1/2 i18n: remove i18n from tag reflog messageJean-Noel Avila, Apr 30, 2017
  4. 2/2 i18n: read-cache: Fix typoJean-Noel Avila, Apr 30, 2017
  5. Junio C HamanoMay 1, 2017
  6. Jean-Noël AVILAMay 3, 2017
  7. Junio C HamanoMay 4, 2017
  8. Junio C HamanoMay 4, 2017
  9. Ævar Arnfjörð BjarmasonMay 1, 2017

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.