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

Re: [PATCH 3/3] advice: translate all actions in error_resolve_conflict()

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 24, 2023, 14:44 UTC
Message-ID
<xmqqcz4y5huz.fsf@gitster.g>
In-Reply-To
<20230323162234.995485-3-oswald.buddenhagen@gmx.de>
Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:
Show 6 quoted lines
> action_name() returns a N_()'d string (for good reasons), so we still
> need to _() it.
>
> In practice, this affects 'rebase'.
>
> Whether this is actually useful is debatable ...

Yes, it is debatable. It may be much better to add a new "else if" that covers the case we _know_ is not covered with the current code.

Having 'me' in _() would be consistent with its source marked with N_() as you found out, but I agree with you that it is debatable if this patch is moving things in the right direction. It would belong to the part that should never be exercised once we give action names proper covering by adding missing "else if".

We could even replace the fallback else with a "else BUG()" to ensure that the action names all callers pass have corresponding message that can be translated without sentence lego.

Thanks.
Show 18 quoted lines
> Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
> ---
>  advice.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/advice.c b/advice.c
> index d6232439c3..f75f3df582 100644
> --- a/advice.c
> +++ b/advice.c
> @@ -192,7 +192,7 @@ int error_resolve_conflict(const char *me)
>  		error(_("Reverting is not possible because you have unmerged files."));
>  	else
>  		error(_("It is not possible to %s because you have unmerged files."),
> -			me);
> +			_(me));
>  
>  	if (advice_enabled(ADVICE_RESOLVE_CONFLICT))
>  		/*
Previous: Oswald BuddenhagenNext: Oswald Buddenhagen
Message 3 of 21 in “Capitalization and punctuation fixes to some user visible messages”
  1. 1/3 Capitalization and punctuation fixes to some user visible messagesOswald Buddenhagen, Mar 23, 2023
  2. 3/3 advice: translate all actions in error_resolve_conflict()Oswald Buddenhagen, Mar 23, 2023
  3. Junio C HamanoMar 24, 2023
  4. 2/3 sequencer: actually translate report in do_exec()Oswald Buddenhagen, Mar 23, 2023
  5. Junio C HamanoMar 23, 2023
  6. Oswald BuddenhagenMar 23, 2023
  7. Junio C HamanoMar 23, 2023
  8. Oswald BuddenhagenMar 23, 2023
  9. Junio C HamanoMar 23, 2023
  10. Oswald BuddenhagenMar 23, 2023
  11. 1/3 advice: handle "rebase" in error_resolve_conflict()Oswald Buddenhagen, Apr 28, 2023
  12. 2/3 sequencer: actually translate report in do_exec()Oswald Buddenhagen, Apr 28, 2023
  13. Junio C HamanoApr 28, 2023
  14. 3/3 Capitalization and punctuation fixes to some user visible messagesOswald Buddenhagen, Apr 28, 2023
  15. Junio C HamanoApr 28, 2023
  16. Junio C HamanoApr 28, 2023
  17. Junio C HamanoApr 28, 2023
  18. Oswald BuddenhagenApr 29, 2023
  19. Junio C HamanoApr 30, 2023
  20. advice: handle "rebase" in error_resolve_conflict()Oswald Buddenhagen, Aug 7, 2023
  21. Junio C HamanoAug 7, 2023

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.