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

Re: [PATCH 2 0/1] Allowing localized substitution hints in parse-options

From
Junio C Hamano <gitster@pobox.com>
Date
May 27, 2024, 18:14 UTC
Message-ID
<xmqqzfsb86le.fsf@gitster.g>
In-Reply-To
<20240525122514.2608-1-ash@kambanaria.org>
Alexander Shopov <ash@kambanaria.org> writes:
Show 12 quoted lines
> 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.

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>".
    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.
Previous: Alexander ShopovNext: Jiang Xin
Message 5 of 16 in “[RESUBMIT 2nd] Consistency for substitution hints (i18n) 0/1]”
  1. [RESUBMIT 2nd] Consistency for substitution hints (i18n) 0/1]Alexander Shopov, Apr 21, 2024
  2. [RESUBMIT 2nd] Consistency for substitution hints (i18n) 1/1] parse-options: use localized substitution hintsAlexander Shopov, Apr 21, 2024
  3. Junio C HamanoApr 21, 2024
  4. 0/1 Allowing localized substitution hints in parse-optionsAlexander Shopov, May 25, 2024
  5. Junio C HamanoMay 27, 2024
  6. Jiang XinMay 28, 2024
  7. 1/1 parse-options: allow localized substitution hints in macrosAlexander Shopov, May 25, 2024
  8. Junio C HamanoMay 27, 2024
  9. 0/1 parse-options: localize mark-up of placeholder text in the short helpAlexander Shopov, Jul 7, 2024
  10. 1/1 parse-options: localize mark-up of placeholder text in the short helpAlexander Shopov, Jul 7, 2024
  11. Alexander ShopovJul 14, 2024
  12. Junio C HamanoJul 15, 2024
  13. 0/1 Localize mark-up of placeholder text in the short helpAlexander Shopov, Dec 28, 2024
  14. 1/1 parse-options: localize mark-up of placeholder text in the short helpAlexander Shopov, Dec 28, 2024
  15. Junio C HamanoDec 28, 2024
  16. Jiang XinDec 30, 2024

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.