Sunday, April 28, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 2019  / 2 Years ago, fri, august 26, 2022, 5:42:46

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.


More From » command-line

 Answers
0

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
/'; }


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

[#34104] Friday, August 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cretanol

Total Points: 320
Total Questions: 99
Total Answers: 115

Location: Australia
Member since Sat, May 27, 2023
1 Year ago
cretanol questions
Fri, Dec 2, 22, 13:30, 1 Year ago
Thu, Dec 8, 22, 03:00, 1 Year ago
Mon, Aug 1, 22, 03:21, 2 Years ago
Fri, Sep 24, 21, 16:28, 3 Years ago
Sun, Apr 24, 22, 06:37, 2 Years ago
;