{"thread":{"id":"61351","subject":"[[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 0/1]","startedAt":"2024-04-21T19:15:01Z","lastAt":"2024-12-30T03:03:06Z","messageCount":16,"participants":["Alexander Shopov","Junio C Hamano","Jiang Xin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"493288","messageId":"20240421191458.5411-1-ash@kambanaria.org","threadId":"61351","inReplyTo":null,"subject":"[[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 0/1]","fromName":"Alexander Shopov","fromEmail":"ash@kambanaria.org","sentAt":"2024-04-21T19:14:56Z","receivedAt":"2024-04-21T19:15:01Z","isPatch":true,"sender":{"key":"ash@kambanaria.org","avatar":"https://avatars.githubusercontent.com/u/449359?v=4"},"body":"Hopefully this is the 3rd time and I will do it right\n\ni18n: as translators choose substitution hints applicable\nto their writing system, expose the ones in parse-options\nfor completeness\n\nAlexander Shopov (1):\n  parse-options: use localized substitution hints\n\n parse-options.c | 15 ++++++++++++---\n 1 file changed, 12 insertions(+), 3 deletions(-)\n\n-- \n2.44.0\n\n"},{"id":"493289","messageId":"20240421191458.5411-2-ash@kambanaria.org","threadId":"61351","inReplyTo":"20240421191458.5411-1-ash@kambanaria.org","subject":"[[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 1/1] parse-options: use localized substitution hints","fromName":"Alexander Shopov","fromEmail":"ash@kambanaria.org","sentAt":"2024-04-21T19:14:57Z","receivedAt":"2024-04-21T19:15:02Z","isPatch":true,"sender":{"key":"ash@kambanaria.org","avatar":"https://avatars.githubusercontent.com/u/449359?v=4"},"body":"i18n: as translators choose substitution hints applicable\nto their writing system, expose the ones in parse-options\nfor completeness\n\nSigned-off-by: Alexander Shopov <ash@kambanaria.org>\n---\n parse-options.c | 15 ++++++++++++---\n 1 file changed, 12 insertions(+), 3 deletions(-)\n\ndiff --git a/parse-options.c b/parse-options.c\nindex 63a99dea6e..2362ca83f3 100644\n--- a/parse-options.c\n+++ b/parse-options.c\n@@ -1061,11 +1061,20 @@ static int usage_argh(const struct option *opts, FILE *outfile)\n \t\t!opts->argh || !!strpbrk(opts->argh, \"()<>[]|\");\n \tif (opts->flags & PARSE_OPT_OPTARG)\n \t\tif (opts->long_name)\n-\t\t\ts = literal ? \"[=%s]\" : \"[=<%s>]\";\n+\t\t\ts = literal ? \"[=%s]\" :\n+\t\t\t  /* TRANSLATORS: keep as is unless you use hints for substitution other than `<>'\n+\t\t\t     in which case use those */\n+\t\t\t  _(\"[=<%s>]\");\n \t\telse\n-\t\t\ts = literal ? \"[%s]\" : \"[<%s>]\";\n+\t\t\ts = literal ? \"[%s]\" :\n+\t\t\t  /* TRANSLATORS: keep as is unless you use hints for substitution other than `<>'\n+\t\t\t     in which case use those */\n+\t\t\t  _(\"[<%s>]\");\n \telse\n-\t\ts = literal ? \" %s\" : \" <%s>\";\n+\t\ts = literal ? \" %s\" :\n+\t\t  /* TRANSLATORS: keep as is unless you use hints for substitution other than `<>'\n+\t\t     in which case use those */\n+\t\t  _(\" <%s>\");\n \treturn utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _(\"...\"));\n }\n \n-- \n2.44.0\n\n"},{"id":"493291","messageId":"xmqq5xwa1pfl.fsf@gitster.g","threadId":"61351","inReplyTo":"20240421191458.5411-2-ash@kambanaria.org","subject":"Re: [[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 1/1] parse-options: use localized substitution hints","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-04-21T19:33:18Z","receivedAt":"2024-04-21T19:33:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexander Shopov <ash@kambanaria.org> writes:\n\n> i18n: as translators choose substitution hints applicable\n> to their writing system, expose the ones in parse-options\n> for completeness\n\nPlease do not mark a patch whose contents has changed with \"RESUBMIT\"\nand the like.  The earlier ones you had had unwanted \"// Fixme\" left\nin the patch and I am guessing that this version has removed them?\nThose who have read the earlier one, when the see the RESUBMIT in\nthe title, would probably have ignored the patch and wouldn't have\nnoticed that this one is improved over the previous attempts.\n\nAs to what the patch tries to achieve, I do not have a strong\nopinion, but the title and the explanation of the patch in the\nproposed log message looked somewhat strange, and the newly added\ncomments looked overly long, all of which you may want to correct\nwhen you send out \"[PATCH v2]\".\n\nThanks.\n\n> Signed-off-by: Alexander Shopov <ash@kambanaria.org>\n> ---\n>  parse-options.c | 15 ++++++++++++---\n>  1 file changed, 12 insertions(+), 3 deletions(-)\n>\n> diff --git a/parse-options.c b/parse-options.c\n> index 63a99dea6e..2362ca83f3 100644\n> --- a/parse-options.c\n> +++ b/parse-options.c\n> @@ -1061,11 +1061,20 @@ static int usage_argh(const struct option *opts, FILE *outfile)\n>  \t\t!opts->argh || !!strpbrk(opts->argh, \"()<>[]|\");\n>  \tif (opts->flags & PARSE_OPT_OPTARG)\n>  \t\tif (opts->long_name)\n> -\t\t\ts = literal ? \"[=%s]\" : \"[=<%s>]\";\n> +\t\t\ts = literal ? \"[=%s]\" :\n> +\t\t\t  /* TRANSLATORS: keep as is unless you use hints for substitution other than `<>'\n> +\t\t\t     in which case use those */\n> +\t\t\t  _(\"[=<%s>]\");\n>  \t\telse\n> -\t\t\ts = literal ? \"[%s]\" : \"[<%s>]\";\n> +\t\t\ts = literal ? \"[%s]\" :\n> +\t\t\t  /* TRANSLATORS: keep as is unless you use hints for substitution other than `<>'\n> +\t\t\t     in which case use those */\n> +\t\t\t  _(\"[<%s>]\");\n>  \telse\n> -\t\ts = literal ? \" %s\" : \" <%s>\";\n> +\t\ts = literal ? \" %s\" :\n> +\t\t  /* TRANSLATORS: keep as is unless you use hints for substitution other than `<>'\n> +\t\t     in which case use those */\n> +\t\t  _(\" <%s>\");\n>  \treturn utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _(\"...\"));\n>  }\n"},{"id":"495634","messageId":"20240525122514.2608-1-ash@kambanaria.org","threadId":"61351","inReplyTo":"xmqq5xwa1pfl.fsf@gitster.g","subject":"[PATCH 2 0/1] Allowing localized substitution hints in parse-options","fromName":"Alexander Shopov","fromEmail":"ash@kambanaria.org","sentAt":"2024-05-25T12:24:37Z","receivedAt":"2024-05-25T12:25:28Z","isPatch":true,"sender":{"key":"ash@kambanaria.org","avatar":"https://avatars.githubusercontent.com/u/449359?v=4"},"body":"I hope this time patch submit is better.\nRequests for changes from previous review should be handled.\n\nparse-options.c contains functions and macros to print messages with\nterms optionally enclosed in chars promting substitution to users such as:\n\n  blah-blah-blah <TERM>\n\nSince languages using different alphabets or writing systems can translate\nthe term in an obvious manner to prompt the user to substitute them, I expose\nthese character to the translators so the messages can use the same style as\nelsewhere in git.\n\nComments to the translators are shorter than before but hopefully they are\nnot cryptic.\n\nAlexander Shopov (1):\n  parse-options: allow localized substitution hints in macros\n\n parse-options.c | 12 +++++++++---\n 1 file changed, 9 insertions(+), 3 deletions(-)\n\n--\n2.45.1\n"},{"id":"495635","messageId":"20240525122514.2608-2-ash@kambanaria.org","threadId":"61351","inReplyTo":"xmqq5xwa1pfl.fsf@gitster.g","subject":"[PATCH 2 1/1] parse-options: allow localized substitution hints in macros","fromName":"Alexander Shopov","fromEmail":"ash@kambanaria.org","sentAt":"2024-05-25T12:24:38Z","receivedAt":"2024-05-25T12:25:29Z","isPatch":true,"sender":{"key":"ash@kambanaria.org","avatar":"https://avatars.githubusercontent.com/u/449359?v=4"},"body":"i18n: expose substitution hint chars in functions and macros to translators\n\nSigned-off-by: Alexander Shopov <ash@kambanaria.org>\n---\n parse-options.c | 12 +++++++++---\n 1 file changed, 9 insertions(+), 3 deletions(-)\n\ndiff --git a/parse-options.c b/parse-options.c\nindex 30b9e68f8a..06d962b00e 100644\n--- a/parse-options.c\n+++ b/parse-options.c\n@@ -1070,11 +1070,17 @@ static int usage_argh(const struct option *opts, FILE *outfile)\n \t\t!opts->argh || !!strpbrk(opts->argh, \"()<>[]|\");\n \tif (opts->flags & PARSE_OPT_OPTARG)\n \t\tif (opts->long_name)\n-\t\t\ts = literal ? \"[=%s]\" : \"[=<%s>]\";\n+\t\t\ts = literal ? \"[=%s]\" :\n+\t\t\t  /* TRANSLATORS: change `<>' to other characters or leave as is */\n+\t\t\t  _(\"[=<%s>]\");\n \t\telse\n-\t\t\ts = literal ? \"[%s]\" : \"[<%s>]\";\n+\t\t\ts = literal ? \"[%s]\" :\n+\t\t\t  /* TRANSLATORS: change `<>' to other characters or leave as is */\n+\t\t\t  _(\"[<%s>]\");\n \telse\n-\t\ts = literal ? \" %s\" : \" <%s>\";\n+\t\ts = literal ? \" %s\" :\n+\t\t  /* TRANSLATORS: change `<>' to other characters or leave as is */\n+\t\t  _(\" <%s>\");\n \treturn utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _(\"...\"));\n }\n \n-- \n2.45.1\n\n"},{"id":"495704","messageId":"xmqqzfsb86le.fsf@gitster.g","threadId":"61351","inReplyTo":"20240525122514.2608-1-ash@kambanaria.org","subject":"Re: [PATCH 2 0/1] Allowing localized substitution hints in parse-options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-05-27T18:14:53Z","receivedAt":"2024-05-27T18:14:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexander Shopov <ash@kambanaria.org> writes:\n\n> I hope this time patch submit is better.\n> Requests for changes from previous review should be handled.\n>\n> parse-options.c contains functions and macros to print messages with\n> terms optionally enclosed in chars promting substitution to users such as:\n>\n>   blah-blah-blah <TERM>\n>\n> Since languages using different alphabets or writing systems can translate\n> the term in an obvious manner to prompt the user to substitute them, I expose\n> these character to the translators so the messages can use the same style as\n> elsewhere in git.\n\nMost of the above explanation, starting from \"parse-options.c\ncontains... \" should replace the proposed log message of the main\npatch [1/1], I would think.  Very clearly written.\n\nThe explanation after \"such as:\" needs improvement, though.  Are you\ntrying to highlight that an explanation is spelled with dashes\nbetween words format?  Are you trying to highlight that the used\nterm is capitalized?  Are you trying to highlight that the term\ncomes after explanation?  The answer is none of the above, but it is\nnot easy for readers to guess.\n\nOne way to make it easier to follow would be to use a more realistic\nexample.  The whole proposed log message may become like so:\n\n    parse-options.c API can show help text for an option that takes\n    an argument.  For the \"--author\" option that takes a name, for\n    example, the program may define the option like so:\n\n\tOPT_STRING(0, \"author\", &au, N_(\"author\"), N_(\"override author\")),\n\n    When the command is run with \"-h\" (short help) option, the above\n    definition is shown as:\n\n        --[no-]author <author>    override author\n\n    As the program does not accept translated option names, the\n    first part of the above, \"--[no-]author\", is given as-is, but\n    the string \"author\" in a pair of \"<>\", and the explanation\n    \"override author\" may be translated into user's language.\n\n    The user's language may use a convention to mark a replaceable\n    part of the command line (called a \"placeholder string\")\n    differently from enclosing it inside a pair of \"<>\", but the\n    implementation in parse-options.c hardcodes \"<%s>\".\n\n    Allow translators to specify the presentation of a placeholder\n    string for their languages by overriding the \"<%s>\".\n\n> Comments to the translators are shorter than before but hopefully they are\n> not cryptic.\n\nWhat is cryptic here is what \"than before\" refers to---compared\nwhat?\n\n  ... goes and looks ...\n\nAh, this is an updated patch for an earlier attempt\n\n  https://lore.kernel.org/git/20240421191458.5411-1-ash@kambanaria.org/\n\nThanks for sticking with this topic.  Very much appreciated.\n\n\n"},{"id":"495705","messageId":"xmqqttij86lc.fsf@gitster.g","threadId":"61351","inReplyTo":"20240525122514.2608-2-ash@kambanaria.org","subject":"Re: [PATCH 2 1/1] parse-options: allow localized substitution hints in macros","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-05-27T18:14:55Z","receivedAt":"2024-05-27T18:14:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexander Shopov <ash@kambanaria.org> writes:\n\n> Subject: Re: [PATCH 2 1/1] parse-options: allow localized substitution hints in macros\n\nThese are not \"macros\", though.  Perhaps\n\n    parse-options: localize marking-up of placeholder text in the short help\n\nor something?  As to the body of the proposed log message, I've\ncovered it in my respoinse of the cover letter.\n\n> diff --git a/parse-options.c b/parse-options.c\n> index 30b9e68f8a..06d962b00e 100644\n> --- a/parse-options.c\n> +++ b/parse-options.c\n> @@ -1070,11 +1070,17 @@ static int usage_argh(const struct option *opts, FILE *outfile)\n>  \t\t!opts->argh || !!strpbrk(opts->argh, \"()<>[]|\");\n>  \tif (opts->flags & PARSE_OPT_OPTARG)\n>  \t\tif (opts->long_name)\n> -\t\t\ts = literal ? \"[=%s]\" : \"[=<%s>]\";\n> +\t\t\ts = literal ? \"[=%s]\" :\n> +\t\t\t  /* TRANSLATORS: change `<>' to other characters or leave as is */\n> +\t\t\t  _(\"[=<%s>]\");\n>  \t\telse\n> -\t\t\ts = literal ? \"[%s]\" : \"[<%s>]\";\n> +\t\t\ts = literal ? \"[%s]\" :\n> +\t\t\t  /* TRANSLATORS: change `<>' to other characters or leave as is */\n> +\t\t\t  _(\"[<%s>]\");\n>  \telse\n> -\t\ts = literal ? \" %s\" : \" <%s>\";\n> +\t\ts = literal ? \" %s\" :\n> +\t\t  /* TRANSLATORS: change `<>' to other characters or leave as is */\n> +\t\t  _(\" <%s>\");\n>  \treturn utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _(\"...\"));\n>  }\n\nJust like user's language may use a convention different from\nenclosing it in a pair of <angle brackets> to mark a placeholder\ntext, the use of [square brackets] to mark an optional part may\nhave different per-language counterpart, no?\n\nThe above change, on the side that handles PARSE_OPT_OPTARG case,\nalready allows \"[=<%s>]\" to be translated, but the translator hints\ncan and should clarify that possibility as well, no?\n\n    /* TRANSLATORS: change [] and <> mark-up, if necessary */\n\nThe SP that appears before <%s> on the mandatory argument side MUST\nNOT be translated.  To go back to the \"--author <author>\" example I\ngave in my response for the cover letter, when the program says:\n\n\tOPT_STRING(0, \"author\", &au, N_(\"author\"), N_(\"override author\")),\n\nin the output of \"git commit -h\", we give\n\n        --[no-]author <AUTHOR>    OVERRIDE AUTHOR\n\nwhere I used uppercase letters for the translated string.  The SP\nbefore <%s> in \" <%s>\" is what we see after \"--[no-]author\" in the\noutput.\n\nSo, if we were to allow localizing this truly, probably the \"else\"\nclause needs a bit more work, e.g.\n\n\tif (opts->flags & PARSE_OPT_OPTARG) {\n\t\t...\n\t} else {\n\t\ts = literal \n\t\t? \"%s\"\n                : _(\"<%s>\");\n\t\tfputc(' ', outfile);\n\t}\n\nThe \"=\" that appears before %s should NOT be translated for exactly\nthe same reason.  If --author were an option that took an optional\nargument, \"git commit -h\" would have given\n\n        --[no-]author[=<AUTHOR>]    OVERRIDE AUTHOR\n\nNo matter what language the user writes, the user MUST write '='\nafter \"--author\" if he or she wants to give an optional argument to\nthe option.  So some care must be taken to make sure they keep '='\neven if they were to translate _(\"[=<%s>]\").  The easiest way to do\nso may be to punt and *tell* them (without us having a way to make\nsure that they followed what we told them to), e.g.\n\n    s = literal \n      ? \"[=%s]\"\n      /*\n       * TRANSLATORS: change [] that signals optional-ness, and\n       * <> that signal placeholder-ness, of what is enclosed \n       * as necessary to match your locale's convention.  Do not\n       * move or change '='; no matter what your language is, the\n       * equal sign MUST be the first character in the optional\n       * string.\n       */\n      : _(\"[=<%s>]\");\n\nOther than the above two points on the \" \" and \"=\" that must not be\nchanged, the intent of this change looks very good to me.\n\nThanks.\n\n"},{"id":"495711","messageId":"CANYiYbHigLbVumfqOF6zMWkRKnthUr-NsOPzPBiv_Q-iaOYZBg@mail.gmail.com","threadId":"61351","inReplyTo":"xmqqzfsb86le.fsf@gitster.g","subject":"Re: [PATCH 2 0/1] Allowing localized substitution hints in parse-options","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2024-05-28T00:47:23Z","receivedAt":"2024-05-28T00:47:36Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"On Tue, May 28, 2024 at 2:14 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Alexander Shopov <ash@kambanaria.org> writes:\n>\n> > I hope this time patch submit is better.\n> > Requests for changes from previous review should be handled.\n> >\n> > parse-options.c contains functions and macros to print messages with\n> > terms optionally enclosed in chars promting substitution to users such as:\n> >\n> >   blah-blah-blah <TERM>\n> >\n> > Since languages using different alphabets or writing systems can translate\n> > the term in an obvious manner to prompt the user to substitute them, I expose\n> > these character to the translators so the messages can use the same style as\n> > elsewhere in git.\n>\n> Most of the above explanation, starting from \"parse-options.c\n> contains... \" should replace the proposed log message of the main\n> patch [1/1], I would think.  Very clearly written.\n\nTypically for a topic with only one commit, it's not necessary to\nprovide a cover letter but provide details in the commit log instead.\n\n>\n> The explanation after \"such as:\" needs improvement, though.  Are you\n> trying to highlight that an explanation is spelled with dashes\n> between words format?  Are you trying to highlight that the used\n> term is capitalized?  Are you trying to highlight that the term\n> comes after explanation?  The answer is none of the above, but it is\n> not easy for readers to guess.\n>\n> One way to make it easier to follow would be to use a more realistic\n> example.  The whole proposed log message may become like so:\n>\n>     parse-options.c API can show help text for an option that takes\n>     an argument.  For the \"--author\" option that takes a name, for\n>     example, the program may define the option like so:\n>\n>         OPT_STRING(0, \"author\", &au, N_(\"author\"), N_(\"override author\")),\n>\n>     When the command is run with \"-h\" (short help) option, the above\n>     definition is shown as:\n>\n>         --[no-]author <author>    override author\n>\n>     As the program does not accept translated option names, the\n>     first part of the above, \"--[no-]author\", is given as-is, but\n>     the string \"author\" in a pair of \"<>\", and the explanation\n>     \"override author\" may be translated into user's language.\n>\n>     The user's language may use a convention to mark a replaceable\n>     part of the command line (called a \"placeholder string\")\n>     differently from enclosing it inside a pair of \"<>\", but the\n>     implementation in parse-options.c hardcodes \"<%s>\".\n\nI guess the reason some people don't like the markers of placeholders\n(such as \"<\" and \">\" characters) is that such characters have special\nmeanings (used as IO redirection) in shell programming and they can be\nreplaced with safer characters for languages other than English.\n\n>\n>     Allow translators to specify the presentation of a placeholder\n>     string for their languages by overriding the \"<%s>\".\n>\n> > Comments to the translators are shorter than before but hopefully they are\n> > not cryptic.\n>\n> What is cryptic here is what \"than before\" refers to---compared\n> what?\n>\n>   ... goes and looks ...\n>\n> Ah, this is an updated patch for an earlier attempt\n>\n>   https://lore.kernel.org/git/20240421191458.5411-1-ash@kambanaria.org/\n>\n> Thanks for sticking with this topic.  Very much appreciated.\n>\n>\n"},{"id":"498199","messageId":"20240707153526.97984-1-ash@kambanaria.org","threadId":"61351","inReplyTo":"xmqqttij86lc.fsf@gitster.g","subject":"[PATCH 3 0/1] parse-options: localize mark-up of placeholder text in the short help","fromName":"Alexander Shopov","fromEmail":"ash@kambanaria.org","sentAt":"2024-07-07T15:35:22Z","receivedAt":"2024-07-07T15:35:40Z","isPatch":true,"sender":{"key":"ash@kambanaria.org","avatar":"https://avatars.githubusercontent.com/u/449359?v=4"},"body":"Hi Junio & Jiang,\n\nI am submitting the patch taking into account the feedback you gave last time.\n\nJust to quickly remind: this allows translatability of \"<>\" chars in:\n\n  OPT_STRING(0, \"author\", &force_author, N_(\"author\"), N_(\"override author\")),\n\ndisplayed as:\n\n    --[no-]author <author>    override author\n\n\n@Junio:\n> ... above explanation ... should replace ... log message\nDone\n\n> The explanation after \"such as:\" needs improvement...\nImproved and closely follows your suggestion\n\n> user's language may use a convention different from ... [square brackets]\n> ... to mark an optional part ...\nI decided againgst implementing this:\n - None of the translators have indicated such a need and adding it makes\n   the whole thing more error prone\n - There is a tiny difference from what I did with the placeholder characters:\n   I am actually skipping the characters in the Bulgarian translation (rather than \n   substituting them) which leads to shorter but still clear messages.  Skipping \n   both \"[]\" and \"<>\" and will lead to confusion.  \"[]\" are not as dangerous as\n   \"<>\" for shell\n - If translators actually request it - it can be implemented when the real need\n   arises\n\n@Jiang\n> ... with only one commit... not necessary to ... provide a cover letter\nI agree but I am using the cover letter to remind what this is all about\nand point what I have done with the code revew.  You can't remember all\ninteractions.\n\n> ... people don't like the markers ... \"<\" and \">\" ... have special\n> meanings ... in shell programming \nI have added something to this meaning in the log message.\n\nKind regards:\nal_shopov\n\nAlexander Shopov (1):\n  parse-options: localize mark-up of placeholder text in the short help\n\n parse-options.c | 12 +++++++++---\n 1 file changed, 9 insertions(+), 3 deletions(-)\n\n-- \n2.45.2\n\n"},{"id":"498200","messageId":"20240707153526.97984-2-ash@kambanaria.org","threadId":"61351","inReplyTo":"xmqqttij86lc.fsf@gitster.g","subject":"[PATCH 3 1/1] parse-options: localize mark-up of placeholder text in the short help","fromName":"Alexander Shopov","fromEmail":"ash@kambanaria.org","sentAt":"2024-07-07T15:35:23Z","receivedAt":"2024-07-07T15:35:41Z","isPatch":true,"sender":{"key":"ash@kambanaria.org","avatar":"https://avatars.githubusercontent.com/u/449359?v=4"},"body":"i18n: expose substitution hint chars in functions and macros to\ntranslators\n\nFor example (based on builtin/commit.c and shortened): the \"--author\"\noption takes a name.  In source this can be represented as:\n\n  OPT_STRING(0, \"author\", &force_author, N_(\"author\"), N_(\"override author\")),\n\nWhen the command is run with \"-h\" (short help) option (git commit -h),\nthe above definition is displayed as:\n\n  --[no-]author <author>    override author\n\nGit does not use translated option names so the first part of the\nabove, \"--[no-]author\", is given as-is (it is based on the 2nd\nargument of OPT_STRING).  However the string \"author\" in the pair of\n\"<>\", and the explanation \"override author for commit\" may be\ntranslated into user's language.\n\nThe user's language may use a convention to mark a replaceable part of\nthe command line (called a \"placeholder string\") differently from\nenclosing it inside a pair of \"<>\", but the implementation in\nparse-options.c hardcodes \"<%s>\".\n\nAllow translators to specify the presentation of a placeholder string\nfor their languages by overriding the \"<%s>\".\n\nIn case the translator's writing system is sufficiently different than\nLatin the \"<>\" characters can be substituted by an empty string thus\neffectively skipping them in the output.  For example languages with\nuppercase versions of characters can use that to deliniate\nreplaceability.\n\nAlternatively a translator can decide to use characters that are\nvisually close to \"<>\" but are not interpreted by the shell.\n\nSigned-off-by: Alexander Shopov <ash@kambanaria.org>\n---\n parse-options.c | 12 +++++++++---\n 1 file changed, 9 insertions(+), 3 deletions(-)\n\ndiff --git a/parse-options.c b/parse-options.c\nindex 30b9e68f8a..06d962b00e 100644\n--- a/parse-options.c\n+++ b/parse-options.c\n@@ -1070,11 +1070,17 @@ static int usage_argh(const struct option *opts, FILE *outfile)\n \t\t!opts->argh || !!strpbrk(opts->argh, \"()<>[]|\");\n \tif (opts->flags & PARSE_OPT_OPTARG)\n \t\tif (opts->long_name)\n-\t\t\ts = literal ? \"[=%s]\" : \"[=<%s>]\";\n+\t\t\ts = literal ? \"[=%s]\" :\n+\t\t\t  /* TRANSLATORS: change `<>' to other characters or leave as is */\n+\t\t\t  _(\"[=<%s>]\");\n \t\telse\n-\t\t\ts = literal ? \"[%s]\" : \"[<%s>]\";\n+\t\t\ts = literal ? \"[%s]\" :\n+\t\t\t  /* TRANSLATORS: change `<>' to other characters or leave as is */\n+\t\t\t  _(\"[<%s>]\");\n \telse\n-\t\ts = literal ? \" %s\" : \" <%s>\";\n+\t\ts = literal ? \" %s\" :\n+\t\t  /* TRANSLATORS: change `<>' to other characters or leave as is */\n+\t\t  _(\" <%s>\");\n \treturn utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _(\"...\"));\n }\n \n-- \n2.45.2\n\n"},{"id":"498692","messageId":"CAP6f5MkGQssKyAdgN3rbzfTZtPgETaSjpm3JevuaLg-vh_pNug@mail.gmail.com","threadId":"61351","inReplyTo":"20240707153526.97984-2-ash@kambanaria.org","subject":"Re: [PATCH 3 1/1] parse-options: localize mark-up of placeholder text in the short help","fromName":"Alexander Shopov","fromEmail":"ash@kambanaria.org","sentAt":"2024-07-14T20:41:28Z","receivedAt":"2024-07-14T20:41:41Z","isPatch":true,"sender":{"key":"ash@kambanaria.org","avatar":"https://avatars.githubusercontent.com/u/449359?v=4"},"body":"Will the patch for expose substitution hint chars be included in 2.46?\nShould I do anything more?\nKind regards:\nal_shopov\n\n\nНа нд, 7.07.2024 г. в 17:35 Alexander Shopov <ash@kambanaria.org> написа:\n>\n> i18n: expose substitution hint chars in functions and macros to\n> translators\n>\n> For example (based on builtin/commit.c and shortened): the \"--author\"\n> option takes a name.  In source this can be represented as:\n>\n>   OPT_STRING(0, \"author\", &force_author, N_(\"author\"), N_(\"override author\")),\n>\n> When the command is run with \"-h\" (short help) option (git commit -h),\n> the above definition is displayed as:\n>\n>   --[no-]author <author>    override author\n>\n> Git does not use translated option names so the first part of the\n> above, \"--[no-]author\", is given as-is (it is based on the 2nd\n> argument of OPT_STRING).  However the string \"author\" in the pair of\n> \"<>\", and the explanation \"override author for commit\" may be\n> translated into user's language.\n>\n> The user's language may use a convention to mark a replaceable part of\n> the command line (called a \"placeholder string\") differently from\n> enclosing it inside a pair of \"<>\", but the implementation in\n> parse-options.c hardcodes \"<%s>\".\n>\n> Allow translators to specify the presentation of a placeholder string\n> for their languages by overriding the \"<%s>\".\n>\n> In case the translator's writing system is sufficiently different than\n> Latin the \"<>\" characters can be substituted by an empty string thus\n> effectively skipping them in the output.  For example languages with\n> uppercase versions of characters can use that to deliniate\n> replaceability.\n>\n> Alternatively a translator can decide to use characters that are\n> visually close to \"<>\" but are not interpreted by the shell.\n>\n> Signed-off-by: Alexander Shopov <ash@kambanaria.org>\n> ---\n>  parse-options.c | 12 +++++++++---\n>  1 file changed, 9 insertions(+), 3 deletions(-)\n>\n> diff --git a/parse-options.c b/parse-options.c\n> index 30b9e68f8a..06d962b00e 100644\n> --- a/parse-options.c\n> +++ b/parse-options.c\n> @@ -1070,11 +1070,17 @@ static int usage_argh(const struct option *opts, FILE *outfile)\n>                 !opts->argh || !!strpbrk(opts->argh, \"()<>[]|\");\n>         if (opts->flags & PARSE_OPT_OPTARG)\n>                 if (opts->long_name)\n> -                       s = literal ? \"[=%s]\" : \"[=<%s>]\";\n> +                       s = literal ? \"[=%s]\" :\n> +                         /* TRANSLATORS: change `<>' to other characters or leave as is */\n> +                         _(\"[=<%s>]\");\n>                 else\n> -                       s = literal ? \"[%s]\" : \"[<%s>]\";\n> +                       s = literal ? \"[%s]\" :\n> +                         /* TRANSLATORS: change `<>' to other characters or leave as is */\n> +                         _(\"[<%s>]\");\n>         else\n> -               s = literal ? \" %s\" : \" <%s>\";\n> +               s = literal ? \" %s\" :\n> +                 /* TRANSLATORS: change `<>' to other characters or leave as is */\n> +                 _(\" <%s>\");\n>         return utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _(\"...\"));\n>  }\n>\n> --\n> 2.45.2\n>\n"},{"id":"498732","messageId":"xmqqjzhm7jgl.fsf@gitster.g","threadId":"61351","inReplyTo":"CAP6f5MkGQssKyAdgN3rbzfTZtPgETaSjpm3JevuaLg-vh_pNug@mail.gmail.com","subject":"Re: [PATCH 3 1/1] parse-options: localize mark-up of placeholder text in the short help","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-07-15T15:39:38Z","receivedAt":"2024-07-15T15:39:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexander Shopov <ash@kambanaria.org> writes:\n\n> Will the patch for expose substitution hint chars be included in 2.46?\n> Should I do anything more?\n\nSorry, I lost track.  Did we resolve why \"<>\" is special and but\n\"[]\" is OK to leave out of the translatable text?  IOW, is there\nmuch point in advising the translators that \"<>\" is something\nspecifically they are allowed to change?\n\nStepping back a bit, would translators (especially for languages\nwithout any need for the ability to replace <> with something else)\nunderstand when told\n\n    TRANSLATORS: change `<>' to other characters or leave as is\n\nwhy anybody would want to change it in the first place?  Stepping\nback even a bit more, probably making it clear to them what these\ninstances of [<%s>], [=<%s>], etc., are doing would be sufficient\nto help them making the right decision?\n\nIf a translator for a hypothetical language that uses say „%s“\nreads\n\n\t/* TRANSLATORS: <%s> here stands for an command line argument */\n\t_(\"<%s>\")\n\nin the comment, wouldn't that be sufficient to tell them they are\nallowed to change \"<>\" to \"„“\"?\n\nSimilarly, explaining [<%s>] as \"optional command line argument\",\nwould tell them that it is OK for them to replace not just <> but\nalso [] if their language requires such a change, no?\n\nThanks for pinging.\n\n>> diff --git a/parse-options.c b/parse-options.c\n>> index 30b9e68f8a..06d962b00e 100644\n>> --- a/parse-options.c\n>> +++ b/parse-options.c\n>> @@ -1070,11 +1070,17 @@ static int usage_argh(const struct option *opts, FILE *outfile)\n>>                 !opts->argh || !!strpbrk(opts->argh, \"()<>[]|\");\n>>         if (opts->flags & PARSE_OPT_OPTARG)\n>>                 if (opts->long_name)\n>> -                       s = literal ? \"[=%s]\" : \"[=<%s>]\";\n>> +                       s = literal ? \"[=%s]\" :\n>> +                         /* TRANSLATORS: change `<>' to other characters or leave as is */\n>> +                         _(\"[=<%s>]\");\n>>                 else\n>> -                       s = literal ? \"[%s]\" : \"[<%s>]\";\n>> +                       s = literal ? \"[%s]\" :\n>> +                         /* TRANSLATORS: change `<>' to other characters or leave as is */\n>> +                         _(\"[<%s>]\");\n>>         else\n>> -               s = literal ? \" %s\" : \" <%s>\";\n>> +               s = literal ? \" %s\" :\n>> +                 /* TRANSLATORS: change `<>' to other characters or leave as is */\n>> +                 _(\" <%s>\");\n>>         return utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _(\"...\"));\n>>  }\n>>\n>> --\n>> 2.45.2\n>>\n"},{"id":"509678","messageId":"20241228114221.10351-3-ash@kambanaria.org","threadId":"61351","inReplyTo":"xmqqjzhm7jgl.fsf@gitster.g","subject":"[PATCH 4 0/1] Localize mark-up of placeholder text in the short help","fromName":"Alexander Shopov","fromEmail":"ash@kambanaria.org","sentAt":"2024-12-28T11:42:17Z","receivedAt":"2024-12-28T11:42:34Z","isPatch":true,"sender":{"key":"ash@kambanaria.org","avatar":"https://avatars.githubusercontent.com/u/449359?v=4"},"body":"Hi Junio,\n\nI am resubmitting this patch to make the substitution placeholder text\nlocalizable.  Fuller explanation and example are given in the commit\nmessage.\n\nI have reworked the translator comments to be fuller, clearer and\nprompt the proper default in case of doubt.\n\nLast time you asked me why I am localizing the `<>' characters for\nsubstitution but not the `[]' for optional values.\n\nThere are several reasons:\n\n1. No one has asked for such a feature so currently there seems to be\nno need for that.  If someone asks - it is easy to provide the feature\nthen.\n\n2. <> are much more dangerous in the shell than [] when copy-pasted\n\n3. So far Bulgarian translation is the only user of the localizability\nof <> and the action there is to omit the characters entirely - they\nare not needed as the alphabets are different.  Omitting them makes\nmessages shorter.  If you omit both <> and [] in messages for\nterseness - messages will be ambiguous.\n\nPlease indicate whether this is fine. I will iterate on the patch\nuntil it is deemed acceptable.\n\nHere are links to previous times I submitted the patch:\n\n3. https://lore.kernel.org/git/20240707153526.97984-1-ash@kambanaria.org/\n2. https://lore.kernel.org/git/20240525122514.2608-1-ash@kambanaria.org/\n1. https://lore.kernel.org/git/20240421180425.78940-1-ash@kambanaria.org/\n0. (check for other teams) https://lore.kernel.org/git/CAP6f5Mmi=f4DPcFwfvEiJMdKMa0BUyZ019mc8uFXyOufgD4NjA@mail.gmail.com/ \n\n\n\nKind regards:\nal_shopov\n\n\nAlexander Shopov (1):\n  parse-options: localize mark-up of placeholder text in the short help\n\n parse-options.c | 18 +++++++++++++++---\n 1 file changed, 15 insertions(+), 3 deletions(-)\n\n-- \n2.47.1\n\n"},{"id":"509679","messageId":"20241228114221.10351-4-ash@kambanaria.org","threadId":"61351","inReplyTo":"xmqqjzhm7jgl.fsf@gitster.g","subject":"[PATCH 4 1/1] parse-options: localize mark-up of placeholder text in the short help","fromName":"Alexander Shopov","fromEmail":"ash@kambanaria.org","sentAt":"2024-12-28T11:42:18Z","receivedAt":"2024-12-28T11:42:37Z","isPatch":true,"sender":{"key":"ash@kambanaria.org","avatar":"https://avatars.githubusercontent.com/u/449359?v=4"},"body":"i18n: expose substitution hint chars in functions and macros to\ntranslators\n\nFor example (based on builtin/commit.c and shortened): the \"--author\"\noption takes a name.  In source this can be represented as:\n\n  OPT_STRING(0, \"author\", &force_author, N_(\"author\"), N_(\"override author\")),\n\nWhen the command is run with \"-h\" (short help) option (git commit -h),\nthe above definition is displayed as:\n\n  --[no-]author <author>    override author\n\nGit does not use translated option names so the first part of the\nabove, \"--[no-]author\", is given as-is (it is based on the 2nd\nargument of OPT_STRING).  However the string \"author\" in the pair of\n\"<>\", and the explanation \"override author for commit\" may be\ntranslated into user's language.\n\nThe user's language may use a convention to mark a replaceable part of\nthe command line (called a \"placeholder string\") differently from\nenclosing it inside a pair of \"<>\", but the implementation in\nparse-options.c hardcodes \"<%s>\".\n\nAllow translators to specify the presentation of a placeholder string\nfor their languages by overriding the \"<%s>\".\n\nIn case the translator's writing system is sufficiently different than\nLatin the \"<>\" characters can be substituted by an empty string thus\neffectively skipping them in the output.  For example languages with\nuppercase versions of characters can use that to deliniate\nreplaceability.\n\nAlternatively a translator can decide to use characters that are\nvisually close to \"<>\" but are not interpreted by the shell.\n\nSigned-off-by: Alexander Shopov <ash@kambanaria.org>\n---\n parse-options.c | 18 +++++++++++++++---\n 1 file changed, 15 insertions(+), 3 deletions(-)\n\ndiff --git a/parse-options.c b/parse-options.c\nindex 33bfba0ed4..8904345c07 100644\n--- a/parse-options.c\n+++ b/parse-options.c\n@@ -1076,11 +1076,23 @@ static int usage_argh(const struct option *opts, FILE *outfile)\n \t\t!opts->argh || !!strpbrk(opts->argh, \"()<>[]|\");\n \tif (opts->flags & PARSE_OPT_OPTARG)\n \t\tif (opts->long_name)\n-\t\t\ts = literal ? \"[=%s]\" : \"[=<%s>]\";\n+\t\t\ts = literal ? \"[=%s]\" :\n+\t\t\t  /* TRANSLATORS: %s is a command line argument name, `<>' prompt the user to supply a value for it.\n+\t\t\t     Change only the `<>' characters to something else if you use another convention for this.\n+\t\t\t     Most translations leave this message as is. */\n+\t\t\t  _(\"[=<%s>]\");\n \t\telse\n-\t\t\ts = literal ? \"[%s]\" : \"[<%s>]\";\n+\t\t\ts = literal ? \"[%s]\" :\n+\t\t\t  /* TRANSLATORS: %s is a command line argument name, `<>' prompt the user to supply a value for it.\n+\t\t\t     Change only the `<>' characters to something else if you use another convention for this.\n+\t\t\t     Most translations leave this message as is. */\n+\t\t\t  _(\"[<%s>]\");\n \telse\n-\t\ts = literal ? \" %s\" : \" <%s>\";\n+\t\ts = literal ? \" %s\" :\n+\t\t  /* TRANSLATORS: %s is a command line argument name, `<>' prompt the user to supply a value for it.\n+\t\t     Change only the `<>' characters to something else if you use another convention for this.\n+\t\t     Most translations leave this message as is. */\n+\t\t  _(\" <%s>\");\n \treturn utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _(\"...\"));\n }\n \n-- \n2.47.1\n\n"},{"id":"509688","messageId":"xmqqy0zz3fxv.fsf@gitster.g","threadId":"61351","inReplyTo":"20241228114221.10351-4-ash@kambanaria.org","subject":"Re: [PATCH 4 1/1] parse-options: localize mark-up of placeholder text in the short help","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-12-28T16:55:40Z","receivedAt":"2024-12-28T16:55:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexander Shopov <ash@kambanaria.org> writes:\n\n> Subject: Re: [PATCH 4 1/1] parse-options: localize mark-up of placeholder text in the short help\n\nIt is more common to see \"[PATCH v4 1/1]\" around here.  In fact, I\nsuspect that you have to fight the tool to have them produce \"[PATCH\n4 1/1]\".\n\nNot that it matters to me personally (as \"git am\" on the receiving\nend will strip it), but when looking for a specific version of your\npatch from the mailing list archive, people may find it harder than\nnecessary because of the subtle difference.\n\n> i18n: expose substitution hint chars in functions and macros to\n> translators\n> ...\n> In case the translator's writing system is sufficiently different than\n> Latin the \"<>\" characters can be substituted by an empty string thus\n> effectively skipping them in the output.  For example languages with\n> uppercase versions of characters can use that to deliniate\n> replaceability.\n>\n> Alternatively a translator can decide to use characters that are\n> visually close to \"<>\" but are not interpreted by the shell.\n\nVery well written.\n\n> diff --git a/parse-options.c b/parse-options.c\n> index 33bfba0ed4..8904345c07 100644\n> --- a/parse-options.c\n> +++ b/parse-options.c\n> @@ -1076,11 +1076,23 @@ static int usage_argh(const struct option *opts, FILE *outfile)\n>  \t\t!opts->argh || !!strpbrk(opts->argh, \"()<>[]|\");\n>  \tif (opts->flags & PARSE_OPT_OPTARG)\n>  \t\tif (opts->long_name)\n> -\t\t\ts = literal ? \"[=%s]\" : \"[=<%s>]\";\n> +\t\t\ts = literal ? \"[=%s]\" :\n> +\t\t\t  /* TRANSLATORS: %s is a command line argument name, `<>' prompt the user to supply a value for it.\n> +\t\t\t     Change only the `<>' characters to something else if you use another convention for this.\n> +\t\t\t     Most translations leave this message as is. */\n> +\t\t\t  _(\"[=<%s>]\");\n\nThis is way too wide.  Documentation/CodingGuidelines should have\nsomething to say on this, but in case it does not, we try to allow\nthose with 80-column terminals to read our code comfortably, and it\nis even better to allow us to do so after a patch is quoted a few\ntimes (i.e. adding a few columns on the left edge), so a practical\nlimit may be around 70-columns.\n\nAlso, our multi-line comments have opening slash-asterisk and closing\nasterisk-slash on their own line.\n\nThis part is giving a help for the option value argument for a long\noption, i.e. for \"git subcommand --option[=<value>]\", we are talking about\nthe \"[=<value>]\" part.  It is not clear \"command line argument name\"\nconveys that.  Something along this line, perhaps?\n\n    The \"<%s>\" part of this string stands for an optional value given to a\n    command line option in the long form, and \"<>\" is there as a\n    convention to signal that it is a placeholder (i.e. the user should\n    substitute it with the real value).  If your language uses a different\n    convention, you can change \"<%s>\" part to match yours, e.g. it might\n    use \"|%s|\" instead, or if the alphabet is different enough it may use\n    \"%s\" without any placeholder signal.  Most translations leave this\n    message as is.\n\n> +\t\t\t  _(\"[=<%s>]\");\n>  \t\telse\n> -\t\t\ts = literal ? \"[%s]\" : \"[<%s>]\";\n> +\t\t\ts = literal ? \"[%s]\" :\n> +\t\t\t  /* TRANSLATORS: %s is a command line argument name, `<>' prompt the user to supply a value for it.\n> +\t\t\t     Change only the `<>' characters to something else if you use another convention for this.\n> +\t\t\t     Most translations leave this message as is. */\n> +\t\t\t  _(\"[<%s>]\");\n\nDitto, except that this is for \"the short form\".\n\n>  \telse\n> -\t\ts = literal ? \" %s\" : \" <%s>\";\n> +\t\ts = literal ? \" %s\" :\n> +\t\t  /* TRANSLATORS: %s is a command line argument name, `<>' prompt the user to supply a value for it.\n> +\t\t     Change only the `<>' characters to something else if you use another convention for this.\n> +\t\t     Most translations leave this message as is. */\n> +\t\t  _(\" <%s>\");\n\nDitto, except that this is for \"a value given to a command line option\",\nnot specific to either long or short form.\n\n>  \treturn utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _(\"...\"));\n>  }\n\n\nI'll queue with the following change on top.\nThanks.\n\n\n parse-options.c | 55 ++++++++++++++++++++++++++++++++++++++++---------------\n 1 file changed, 40 insertions(+), 15 deletions(-)\n\ndiff --git c/parse-options.c w/parse-options.c\nindex 8904345c07..3ff6a5d1fa 100644\n--- c/parse-options.c\n+++ w/parse-options.c\n@@ -1076,23 +1076,48 @@ static int usage_argh(const struct option *opts, FILE *outfile)\n \t\t!opts->argh || !!strpbrk(opts->argh, \"()<>[]|\");\n \tif (opts->flags & PARSE_OPT_OPTARG)\n \t\tif (opts->long_name)\n-\t\t\ts = literal ? \"[=%s]\" :\n-\t\t\t  /* TRANSLATORS: %s is a command line argument name, `<>' prompt the user to supply a value for it.\n-\t\t\t     Change only the `<>' characters to something else if you use another convention for this.\n-\t\t\t     Most translations leave this message as is. */\n-\t\t\t  _(\"[=<%s>]\");\n+\t\t\t/*\n+\t\t\t * TRANSLATORS: The \"<%s>\" part of this string\n+\t\t\t * stands for an optional value given to a command\n+\t\t\t * line option in the long form, and \"<>\" is there\n+\t\t\t * as a convention to signal that it is a\n+\t\t\t * placeholder (i.e. the user should substitute it\n+\t\t\t * with the real value).  If your language uses a\n+\t\t\t * different convention, you can change \"<%s>\" part\n+\t\t\t * to match yours, e.g. it might use \"|%s|\" instead,\n+\t\t\t * or if the alphabet is different enough it may use\n+\t\t\t * \"%s\" without any placeholder signal.  Most\n+\t\t\t * translations leave this message as is.\n+\t\t\t */\n+\t\t\ts = literal ? \"[=%s]\" : _(\"[=<%s>]\");\n \t\telse\n-\t\t\ts = literal ? \"[%s]\" :\n-\t\t\t  /* TRANSLATORS: %s is a command line argument name, `<>' prompt the user to supply a value for it.\n-\t\t\t     Change only the `<>' characters to something else if you use another convention for this.\n-\t\t\t     Most translations leave this message as is. */\n-\t\t\t  _(\"[<%s>]\");\n+\t\t\t/*\n+\t\t\t * TRANSLATORS: The \"<%s>\" part of this string\n+\t\t\t * stands for an optional value given to a command\n+\t\t\t * line option in the short form, and \"<>\" is there\n+\t\t\t * as a convention to signal that it is a\n+\t\t\t * placeholder (i.e. the user should substitute it\n+\t\t\t * with the real value).  If your language uses a\n+\t\t\t * different convention, you can change \"<%s>\" part\n+\t\t\t * to match yours, e.g. it might use \"|%s|\" instead,\n+\t\t\t * or if the alphabet is different enough it may use\n+\t\t\t * \"%s\" without any placeholder signal.  Most\n+\t\t\t * translations leave this message as is.\n+\t\t\t */\n+\t\t\ts = literal ? \"[%s]\" : _(\"[<%s>]\");\n \telse\n-\t\ts = literal ? \" %s\" :\n-\t\t  /* TRANSLATORS: %s is a command line argument name, `<>' prompt the user to supply a value for it.\n-\t\t     Change only the `<>' characters to something else if you use another convention for this.\n-\t\t     Most translations leave this message as is. */\n-\t\t  _(\" <%s>\");\n+\t\t/*\n+\t\t * TRANSLATORS: The \"<%s>\" part of this string stands for a\n+\t\t * value given to a command line option, and \"<>\" is there\n+\t\t * as a convention to signal that it is a placeholder\n+\t\t * (i.e. the user should substitute it with the real value).\n+\t\t * If your language uses a different convention, you can\n+\t\t * change \"<%s>\" part to match yours, e.g. it might use\n+\t\t * \"|%s|\" instead, or if the alphabet is different enough it\n+\t\t * may use \"%s\" without any placeholder signal.  Most\n+\t\t * translations leave this message as is.\n+\t\t */\n+\t\ts = literal ? \" %s\" : _(\" <%s>\");\n \treturn utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _(\"...\"));\n }\n \n"},{"id":"509713","messageId":"CANYiYbE+4AsbKjCjEJj+MjA7vxfSW4XWbYZrNaobnp6=TsboPg@mail.gmail.com","threadId":"61351","inReplyTo":"CAP6f5MkYL8PgRyf_paCYxL-LE5nUa2U1GQMsu2scLzJPSS=9Ag@mail.gmail.com","subject":"Re: [PATCH 4 1/1] parse-options: localize mark-up of placeholder text in the short help","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2024-12-30T03:02:55Z","receivedAt":"2024-12-30T03:03:06Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"On Sun, Dec 29, 2024 at 1:12 AM Alexander Shopov <ash@kambanaria.org> wrote:\n>\n> Thanks a lot for applying and especially for the  feedback.\n>\n> > you have to fight the tool to have them produce \"[PATCH 4 1/1]\"\n> The command I used was\n> git format-patch ... --subject-prefix 'PATCH 4' ...\n> I guess I should use --subject-prefix 'PATCH v4' unless there is some other trick I am missing.\n\nYou should use \"git format-patch --thread -v4\" or \"--reroll-count=4\" instead.\n\n--\nJiang Xin\n"}]}