Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a Command line translator for Ubuntu that has multiple languages? With languages need English, Japanese, Chinese, Vietnamese, Korean, etc Also nothing using Google works anymore.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

perhaps you can try the python script found here. It uses the google translate API.

Edit: seems that that api is a paid service now. Maybe you can use the oneliner from commandlinefu

 translate(){ wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=$2|${3:-en}" | sed 's/.*"translatedText":"\([^"]*\)".*}/\1\n/'; }

Edit 2: try using libtranslate-bin available from the repositories

example usage:

 echo "hello" | translate-bin -f en -l

and to use google translate:

 echo "what are you doing" | translate-bin -s google -f en -t fr

and to convert kanji to romaji

echo "what are you doing" | translate-bin -s google -f en -t ja | iconv -f utf8 -t eucjp | kakasi -i euc -w | kakasi -i euc -Ha -Ka -Ja -Ea -ka
share|improve this answer
    
none of the google ones work anymore –  zeitue Nov 22 '12 at 23:44
    
I edited my post. –  Goez Nov 22 '12 at 23:55
    
Thanks, works awesome. –  zeitue Nov 23 '12 at 1:42
    
is there a way to get romanized Japanese? –  zeitue Nov 23 '12 at 2:28

Recently I needed to do the same thing (albeit under Windows) and came across this question. I managed to compile libtranslate under windows, but I coulden't get it to work for various reasons (it failed to load services.xml no matter what I did).

I asked this question and got an answer. The suggested answer was to use Translate Shell which is just a single sh file. I had to tinker a bit to have it run on Windows the way I want, but there should be no problem using this tool on Ubuntu (in worst case scenario you'll have to install some dependencies).

Like libtranslate, Translate Shell also uses Google Translate.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.