translate-shell
translate-shell copied to clipboard
Translate many lines at once?
I'd love to use this program to pipe emails from Mutt into and translate them. When I do this, it translates each individual line at a time, seemingly round-tripping each line to/from Google. I feel like this is going to get me blacklisted from Google if I do it too much. Is there a way to tell it to just translate all of stdin in one go, instead of doing it line by line?
In order to translate some very long text, POST requests should be used instead of GET, because the maximum length that trans can handle has a limitation (see #30 for details). It's not implemented yet but on my future plan.
For now, you could pipe any text like (if you want to a complete translation of stdin)
echo "good\nmorning" | xargs | trans :ja
However, if stdin grows too large, this might not work as expected.
Is this something you'd accept a PR for?
Sure, PRs are always welcome, as long as it's useful and properly implemented.
This is still not available? I found out the hard way piping some text to trans and then Google starting to reject my requests. Please please add this feature.