git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Jean-Noel Avila <jn.avila@free.fr>
Cc: Git Mailing List <git@vger.kernel.org>,
	Jiang Xin <worldhello.net@gmail.com>,
	Cornelius Weig <cornelius.weig@tngtech.com>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] i18n: remove i18n from tag reflog message
Date: Mon, 1 May 2017 11:15:20 +0200	[thread overview]
Message-ID: <CACBZZX6kVihx43o7AKkb+DZtPUoHOw027VpLcMD-09fN=XnxbA@mail.gmail.com> (raw)
In-Reply-To: <20170429100253.4710-1-jn.avila@free.fr>

On Sat, Apr 29, 2017 at 12:02 PM, Jean-Noel Avila <jn.avila@free.fr> wrote:
> 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.

[CC'd Cornelius Weig who added the code you're modifying]

If I'm reading this correctly this is a good patch but quite a bad
explanation of what we're changing.

The problem here is not that it's cumbersome to translate this using
strbuf, but that we're injecting i18n'd messages into the reflog, so
e.g. someone with a Chinese locale creating a tag in a shared repo
will cause the Chinese i18n message to be inserted into the reflog,
and then someone with e.g. a German or English locale will see the
Chinese messages when they run "git reflog".

That's a very bad thing, and in some ways worse than translating
plumbing messages, because here we're injecting i18n'd messages into
the on-disk format.

Luckily this hasn't made it into 2.13 yet. Junio, if the above
description is accurate then this is something we definitely want in
the final 2.13.


> 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, ')');
> --
> 2.12.0
>

      parent reply	other threads:[~2017-05-01  9:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-29 10:02 [PATCH] i18n: remove i18n from tag reflog message Jean-Noel Avila
2017-04-30 21:32 ` [PATCH v2] i18n patches to apply for rc2 Jean-Noel Avila
2017-04-30 21:32   ` [PATCH v2 1/2] i18n: remove i18n from tag reflog message Jean-Noel Avila
2017-04-30 21:32   ` [PATCH v2 2/2] i18n: read-cache: Fix typo Jean-Noel Avila
2017-05-01  1:45 ` [PATCH] i18n: remove i18n from tag reflog message Junio C Hamano
2017-05-03 16:38   ` Jean-Noël AVILA
2017-05-04  1:35     ` Junio C Hamano
2017-05-04  1:38     ` Junio C Hamano
2017-05-01  9:15 ` Ævar Arnfjörð Bjarmason [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACBZZX6kVihx43o7AKkb+DZtPUoHOw027VpLcMD-09fN=XnxbA@mail.gmail.com' \
    --to=avarab@gmail.com \
    --cc=cornelius.weig@tngtech.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jn.avila@free.fr \
    --cc=worldhello.net@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).