You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One things that has bugged me since the advent of AI coding tools such as Cursor: I feel like those IDEs really struggle with translating the .po files (super slow because they usually do it line by line, wonky translations and also incomplete translations when adding many translations at the same time).
I find it especially funny because GPTs originally built by Google were meant to be this new way of translating languages and now in the whole development cycle the only thing that I do manually is writing translations.
I wrote some python script for myself that takes .po files, parses missing translations + cleverly adds existing translated strings as context and then automatically translates all missing strings. And now using lingui is SO much fun again.
So I was wondering: Is this something you'd be interested in having added to the lingui CLI scripts?
Proposed Solution
Add a standard CLI script, just like compile and extract. It could be called translate.
In my script i use gpt-4o to do the translations. In theory we could make it model agnostic, however I'm also a big fan of keeping it simple.
Requirements to run the script:
To run the script, the users need a OPENAI_API_KEY env variable.
python3 (or whatever runtime we want to use to implement this - honstely haven't looked into how your other CLI commands are implemented)
Alternatives Considered
Everyone can obviously ask ChatGPT and the likes to build this script from scratch and just run it locally in their repos. That's the way I do it right now.
This is a great idea! The automatic translation feature you described is already offered by the third-party CLI companion tool Linguito: https://github.com/antropia-studio/linguito. Linguito provides a linguito translate command that uses a configurable LLM to automatically fill in missing .po strings, often including an option for interactive review.
Please take a look at this and let us know what you think.
Linguito looks great. Thanks for pointing it out. Its also interesting to see how they do their translations!
I personally think (for what its worth lol) that the translate should be part of lingui itself. AI in development has really landed and I feel like it is to be considered as part of our standard workflows these days. And while linguito brings that functionality, it also adds other things that are already part of lingui.
the linguito check essentially does the same as lingui extract (that will also tell you about any missing translations)
the linguito format does some formatting + removes empty translations (which is done by the --clean flag already in lingui).
So aside from the translate i don't think it adds a lot of inherent value but rather provides a different interface to interact with lingui. Which other people surely find valuable!! Im a big fan of keeping my web-dev stack as slim as possible, having been traumatized of create-react-app and the likes.
And to me it feels very natural to have the three
lingui extract
lingui translate
lingui compile
because translate bridges the other two commands as a natural part of the workflow.
With that being said, I just want to present my opinion but don't mean to push it onto anyone, especially not being part of the project!
If you don't agree with it, feel free to close the issue! 🚀
Yes, having that capability out-of-the-box definitely makes the experience feel more natural and intuitive.
I was also thinking about a similar enhancement that involves the OPENAI_API_KEY configuration, specifically for the extract command. We could use AI to automatically generate a helpful comment for the string based on its location and context in the code. This feature should improve the context provided to both AI and human linguists, leading to higher-quality translations.
On a side note, I just noticed a recent message in our Discord server. Someone posted about a different tool they created for AI translation of message catalogs - you can find the message here.
Activity
andrii-bodnar commentedon Oct 9, 2025
Hi @christian-egger-augedo, thank you for the suggestion!
This is a great idea! The automatic translation feature you described is already offered by the third-party CLI companion tool Linguito: https://github.com/antropia-studio/linguito. Linguito provides a
linguito translatecommand that uses a configurable LLM to automatically fill in missing.postrings, often including an option for interactive review.Please take a look at this and let us know what you think.
christian-egger-augedo commentedon Oct 10, 2025
Linguito looks great. Thanks for pointing it out. Its also interesting to see how they do their translations!
I personally think (for what its worth lol) that the
translateshould be part oflinguiitself. AI in development has really landed and I feel like it is to be considered as part of our standard workflows these days. And while linguito brings that functionality, it also adds other things that are already part oflingui.linguito checkessentially does the same aslingui extract(that will also tell you about any missing translations)linguito formatdoes some formatting + removes empty translations (which is done by the --clean flag already in lingui).So aside from the
translatei don't think it adds a lot of inherent value but rather provides a different interface to interact withlingui. Which other people surely find valuable!! Im a big fan of keeping my web-dev stack as slim as possible, having been traumatized ofcreate-react-appand the likes.And to me it feels very natural to have the three
lingui extractlingui translatelingui compilebecause
translatebridges the other two commands as a natural part of the workflow.With that being said, I just want to present my opinion but don't mean to push it onto anyone, especially not being part of the project!
If you don't agree with it, feel free to close the issue! 🚀
andrii-bodnar commentedon Oct 10, 2025
Yes, having that capability out-of-the-box definitely makes the experience feel more natural and intuitive.
I was also thinking about a similar enhancement that involves the
OPENAI_API_KEYconfiguration, specifically for theextractcommand. We could use AI to automatically generate a helpful comment for the string based on its location and context in the code. This feature should improve the context provided to both AI and human linguists, leading to higher-quality translations.On a side note, I just noticed a recent message in our Discord server. Someone posted about a different tool they created for AI translation of message catalogs - you can find the message here.