git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Alex Henrie <alexhenrie24@gmail.com>
To: Derrick Stolee <derrickstolee@github.com>
Cc: git@vger.kernel.org, vdye@github.com, gitster@pobox.com
Subject: Re: [PATCH] builtin/diagnose.c: don't translate the two mode values
Date: Tue, 20 Sep 2022 11:54:33 -0600	[thread overview]
Message-ID: <CAMMLpeRJ=4ES6d7pRP1Y232GyLx-jhN-ktfVernXrDiJuAC+tQ@mail.gmail.com> (raw)
In-Reply-To: <84848326-5cd9-b5b9-2dcb-a6d49879f47b@github.com>

On Tue, Sep 20, 2022 at 6:35 AM Derrick Stolee <derrickstolee@github.com> wrote:
>
> In diff.c, the descriptors exist in angle brackets, so the right thing
> would be N_("<mode>"). This seems non-standard compared to most other
> places.

I don't know which form is preferred in the code, but I did find that
usage_argh adds the angle brackets if they are not already present:

static int usage_argh(const struct option *opts, FILE *outfile)
{
    const char *s;
    int literal = (opts->flags & PARSE_OPT_LITERAL_ARGHELP) ||
        !opts->argh || !!strpbrk(opts->argh, "()<>[]|");
    if (opts->flags & PARSE_OPT_OPTARG)
        if (opts->long_name)
            s = literal ? "[=%s]" : "[=<%s>]";
        else
            s = literal ? "[%s]" : "[<%s>]";
    else
        s = literal ? " %s" : " <%s>";
    return utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _("..."));
}

> Here is a similar stale translatable regex in diff.c:
>
>                 OPT_CALLBACK_F(0, "diff-filter", options, N_("[(A|C|D|M|R|T|U|X|B)...[*]]"),
>                                N_("select files by diff type"),
>
> So if you are looking into these kinds of replacements, it might be
> good to add instances like this. They are less important to the 2.38.0
> release, though.

Yeah, that one probably shouldn't be translatable either.

> This long-winded email is all just to say that I've looked into the
> standard way to handle this and agree that you are changing the code
> to match our best practices.

Thanks! I appreciate the feedback.

-Alex

      reply	other threads:[~2022-09-20 17:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20  5:06 [PATCH] builtin/diagnose.c: don't translate the two mode values Alex Henrie
2022-09-20 12:35 ` Derrick Stolee
2022-09-20 17:54   ` Alex Henrie [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='CAMMLpeRJ=4ES6d7pRP1Y232GyLx-jhN-ktfVernXrDiJuAC+tQ@mail.gmail.com' \
    --to=alexhenrie24@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=vdye@github.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).