Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Improve support for CLI translations using gettext #417

Merged
merged 5 commits into from
Mar 23, 2024

Conversation

mjodmj
Copy link
Contributor

@mjodmj mjodmj commented Jul 10, 2022

Just adding some missing wrappings of strings around gettext which some may need for the sake of CLI i18n.

Copy link

@ereslibre ereslibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just chiming in to say that it would be nice to have this one merged :)

Edit: this PR might also consider removing the TODO about this very change: https://github.com/tiangolo/typer/blob/046d3e2b4cb1f2feb6d94b856aa75e013d9896c6/typer/core.py#L623-L626

@svlandeg svlandeg added bug Something isn't working p2 labels Mar 6, 2024
@svlandeg svlandeg marked this pull request as draft March 19, 2024 14:26
@svlandeg svlandeg marked this pull request as ready for review March 19, 2024 15:02
Copy link
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

I took the liberty of updating your PR with the latest changes from master. This looks good to me.

@ereslibre
Copy link

ereslibre commented Mar 19, 2024

Thanks @svlandeg! I do wonder if we should also update some of the strings at https://github.com/tiangolo/typer/blob/74433d22b489d13fe1a0bb1f6729127cfa942996/typer/rich_utils.py#L83-L93

If you are fine with it I can create a PR if you don't want to update this one with those.

@svlandeg
Copy link
Member

Good idea to add those @ereslibre - I've pushed directly to this PR to keep the work together. Feel free to review!

@tiangolo tiangolo changed the title Add some wraps around gettext ✨ Improve support for CLI translations uisng gettext Mar 23, 2024
@tiangolo tiangolo added feature New feature, enhancement or request and removed bug Something isn't working labels Mar 23, 2024
@tiangolo tiangolo merged commit fe9538c into fastapi:master Mar 23, 2024
18 checks passed
@tiangolo
Copy link
Member

Great, thank you @mjodmj! 🤓

And thanks for the review @svlandeg 🙇

This will be available in Typer 0.9.4 in the next few hours. 🚀

@tiangolo tiangolo changed the title ✨ Improve support for CLI translations uisng gettext ✨ Improve support for CLI translations using gettext Mar 23, 2024
@ereslibre
Copy link

@tiangolo did beat me to it! Sorry for the lag on the review and thank you everyone involved :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature, enhancement or request p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants