For example if you have a .txt file you copy and paste, then copy and paste the translated version, quite a bit uncomfortable for long texts, and so with a quick google I found this handy little python script that allows you to work from command line.
Usage: translate [–help|-h]
[(–source|-s) <source language>]
[(–destination|–dest|-d) <destination language>]
[(–filename|–file|-f) <filename>|<text to translate> …]
The script translate some text from one language to another, giving the result on standard output.
By default, translate runs as a filter (accepting text to translate on standard input and outputting the result to standard output).
Source language defaults to auto-detection (which can be specified with “-s -“) and destination language defaults to English. Languages should be entered as language codes, for instance en, de, es. Inspect http://translate.google.com for a full list of supported languages. If auto-detection is used, the language detected will be shown on stderr.
If there are no non-option arguments the text to translate is taken from stdin by default (which is the same as giving “-f -“). If there are non-option arguments these are instead taken as the source text. If you want to use it this way, it’s best to give the argument “–” to show that no more options will appear. Alternatively a file can be used as input by using the -f option.
All information and error messages go to standard error and so quiet operation is possible by redirecting stderr to /dev/null, for example
translate -d de -f story_en.txt 2>/dev/null
The –verbose or -v switch enables verbose output (to stderr).
- None Found