git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiang Xin <worldhello.net@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Alexander Shopov <ash@kambanaria.org>, git@vger.kernel.org
Subject: Re: [PATCH 2 0/1] Allowing localized substitution hints in parse-options
Date: Tue, 28 May 2024 08:47:23 +0800	[thread overview]
Message-ID: <CANYiYbHigLbVumfqOF6zMWkRKnthUr-NsOPzPBiv_Q-iaOYZBg@mail.gmail.com> (raw)
In-Reply-To: <xmqqzfsb86le.fsf@gitster.g>

On Tue, May 28, 2024 at 2:14 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Alexander Shopov <ash@kambanaria.org> writes:
>
> > I hope this time patch submit is better.
> > Requests for changes from previous review should be handled.
> >
> > parse-options.c contains functions and macros to print messages with
> > terms optionally enclosed in chars promting substitution to users such as:
> >
> >   blah-blah-blah <TERM>
> >
> > Since languages using different alphabets or writing systems can translate
> > the term in an obvious manner to prompt the user to substitute them, I expose
> > these character to the translators so the messages can use the same style as
> > elsewhere in git.
>
> Most of the above explanation, starting from "parse-options.c
> contains... " should replace the proposed log message of the main
> patch [1/1], I would think.  Very clearly written.

Typically for a topic with only one commit, it's not necessary to
provide a cover letter but provide details in the commit log instead.

>
> The explanation after "such as:" needs improvement, though.  Are you
> trying to highlight that an explanation is spelled with dashes
> between words format?  Are you trying to highlight that the used
> term is capitalized?  Are you trying to highlight that the term
> comes after explanation?  The answer is none of the above, but it is
> not easy for readers to guess.
>
> One way to make it easier to follow would be to use a more realistic
> example.  The whole proposed log message may become like so:
>
>     parse-options.c API can show help text for an option that takes
>     an argument.  For the "--author" option that takes a name, for
>     example, the program may define the option like so:
>
>         OPT_STRING(0, "author", &au, N_("author"), N_("override author")),
>
>     When the command is run with "-h" (short help) option, the above
>     definition is shown as:
>
>         --[no-]author <author>    override author
>
>     As the program does not accept translated option names, the
>     first part of the above, "--[no-]author", is given as-is, but
>     the string "author" in a pair of "<>", and the explanation
>     "override author" may be translated into user's language.
>
>     The user's language may use a convention to mark a replaceable
>     part of the command line (called a "placeholder string")
>     differently from enclosing it inside a pair of "<>", but the
>     implementation in parse-options.c hardcodes "<%s>".

I guess the reason some people don't like the markers of placeholders
(such as "<" and ">" characters) is that such characters have special
meanings (used as IO redirection) in shell programming and they can be
replaced with safer characters for languages other than English.

>
>     Allow translators to specify the presentation of a placeholder
>     string for their languages by overriding the "<%s>".
>
> > Comments to the translators are shorter than before but hopefully they are
> > not cryptic.
>
> What is cryptic here is what "than before" refers to---compared
> what?
>
>   ... goes and looks ...
>
> Ah, this is an updated patch for an earlier attempt
>
>   https://lore.kernel.org/git/20240421191458.5411-1-ash@kambanaria.org/
>
> Thanks for sticking with this topic.  Very much appreciated.
>
>

  reply	other threads:[~2024-05-28  0:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-21 19:14 [[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 0/1] Alexander Shopov
2024-04-21 19:14 ` [[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 1/1] parse-options: use localized substitution hints Alexander Shopov
2024-04-21 19:33   ` Junio C Hamano
2024-05-25 12:24     ` [PATCH 2 0/1] Allowing localized substitution hints in parse-options Alexander Shopov
2024-05-27 18:14       ` Junio C Hamano
2024-05-28  0:47         ` Jiang Xin [this message]
2024-05-25 12:24     ` [PATCH 2 1/1] parse-options: allow localized substitution hints in macros Alexander Shopov
2024-05-27 18:14       ` Junio C Hamano
2024-07-07 15:35         ` [PATCH 3 0/1] parse-options: localize mark-up of placeholder text in the short help Alexander Shopov
2024-07-07 15:35         ` [PATCH 3 1/1] " Alexander Shopov
2024-07-14 20:41           ` Alexander Shopov
2024-07-15 15:39             ` Junio C Hamano
2024-12-28 11:42               ` [PATCH 4 0/1] Localize " Alexander Shopov
2024-12-28 11:42               ` [PATCH 4 1/1] parse-options: localize " Alexander Shopov
2024-12-28 16:55                 ` Junio C Hamano
     [not found]                   ` <CAP6f5MkYL8PgRyf_paCYxL-LE5nUa2U1GQMsu2scLzJPSS=9Ag@mail.gmail.com>
2024-12-30  3:02                     ` Jiang Xin

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=CANYiYbHigLbVumfqOF6zMWkRKnthUr-NsOPzPBiv_Q-iaOYZBg@mail.gmail.com \
    --to=worldhello.net@gmail.com \
    --cc=ash@kambanaria.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).