Skip to content

Commit

Permalink
✨ Allow gettext translation of help message (#886)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
svlandeg and pre-commit-ci[bot] authored Nov 18, 2024
1 parent 3b7fe59 commit 96a61f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion typer/rich_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
COMMANDS_PANEL_TITLE = _("Commands")
ERRORS_PANEL_TITLE = _("Error")
ABORTED_TEXT = _("Aborted.")
RICH_HELP = _("Try [blue]'{command_path} {help_option}'[/] for help.")

MARKUP_MODE_MARKDOWN = "markdown"
MARKUP_MODE_RICH = "rich"
Expand Down Expand Up @@ -688,7 +689,9 @@ def rich_format_error(self: click.ClickException) -> None:

if ctx is not None and ctx.command.get_help_option(ctx) is not None:
console.print(
f"Try [blue]'{ctx.command_path} {ctx.help_option_names[0]}'[/] for help.",
RICH_HELP.format(
command_path=ctx.command_path, help_option=ctx.help_option_names[0]
),
style=STYLE_ERRORS_SUGGESTION,
)

Expand Down

0 comments on commit 96a61f8

Please sign in to comment.