git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: Denton Liu <liu.denton@gmail.com>,
	Git Mailing List <git@vger.kernel.org>,
	Robert Simpson <no-reply@mailscreen.com>
Subject: Re: [PATCH] switch: fix errors and comments related to -c and -C
Date: Wed, 29 Apr 2020 12:31:33 -0400	[thread overview]
Message-ID: <CAPig+cS-f7JOkhW7yf_h4bXx75Y_=_0e7uPTCfkBCHvc8WSUBw@mail.gmail.com> (raw)
In-Reply-To: <20200429160948.GB83442@syl.local>

On Wed, Apr 29, 2020 at 12:10 PM Taylor Blau <me@ttaylorr.com> wrote:
> On Wed, Apr 29, 2020 at 05:00:19AM -0400, Denton Liu wrote:
> > In d787d311db (checkout: split part of it to new command 'switch',
> > 2019-03-29), the `git switch` command was created by extracting the
> > common functionality of cmd_checkout() in checkout_main(). However, in
> > b7b5fce270 (switch: better names for -b and -B, 2019-03-29), these
> > the branch creation and force creation options for 'switch' were changed

s/these the/the/

> > to -c and -C, respectively. As a result of this, error messages and
> > comments that previously referred to `-b` and `-B` became invalid for
> > `git switch`.
> >
> > For comments that refer to `-b` and `-B`, add `-c` and `-C` to the
> > comment.
>
> I had to read this sentence a couple of times more than I would have
> liked to in order to grok it fully. Would it be perhaps clearer as:
>
>   Update comments in 'cmd_checkout()' that mention `-b` or `-B` to
>   instead refer to `-c` or `-C` when invoked from 'git switch'.

I had no problem groking Denton's wording but had to re-read this
proposal several times before understanding it. I could try providing
yet another proposal, however, I think the entire sentence can simply
be dropped (after all, it's just stating the obvious).

> > +             die(variant == CMD_CHECKOUT ?
> > +                             _("-b, -B and --orphan are mutually exclusive") :
> > +                             _("-c, -C and --orphan are mutually exclusive"));
>
> Hmm. Do we need to generate an extra string for translation here? If the
> string was instead:
>
>   _("%s and --orphan are mutually exclusive")
>
> where the first format string is filled in something like:
>
>   die(_("%s and --orphan are mutually exclusive"),
>       variant == CMD_CHECKOUT ? "-b, -B" : "-c, -C");
>
> may save translators some work.

We don't know the grammatical or syntactic rules of each language, so
hard-coding untranslatable "-b, -B" is contraindicated. Since the
option letters ought not be translated (just as "--orphan" shouldn't
be), the letters themselves could be interpolated into the string.
However, that's probably less helpful for translators since it
eliminates contextual clues. Therefore, it seems like a good idea to
leave it as two separate translatable strings (as the patch already
does).

  reply	other threads:[~2020-04-29 16:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 23:12 Git error message suggests an invalid switch Robert Simpson
2020-04-29  9:00 ` [PATCH] switch: fix errors and comments related to -c and -C Denton Liu
2020-04-29 16:09   ` Taylor Blau
2020-04-29 16:31     ` Eric Sunshine [this message]
2020-04-29 16:35   ` Junio C Hamano
2020-04-30 11:54   ` [PATCH v2] " Denton Liu
2020-04-30 16:21     ` Taylor Blau
2020-04-30 20:45       ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to='CAPig+cS-f7JOkhW7yf_h4bXx75Y_=_0e7uPTCfkBCHvc8WSUBw@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=liu.denton@gmail.com \
    --cc=me@ttaylorr.com \
    --cc=no-reply@mailscreen.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.
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 NNTP newsgroup(s).