Yep, but i'd like to do that on my linux desktop...
Did you try this...
]]>Thanks, definitely not what i need.
To make it simple, now i copy and past into google translator.I'd like to do it offline!
I have a nexus 7 tablet that can download the Google translator to work offline via google play.
You can select the language you need instead of all of them
I am asuming iconv is perl-text-iconv
No, I don't have that installed.
pacman -Ss iconv
extra/perl-text-iconv 1.7-8
interesting script but not working for me.
I just checked, it doesn't work here anymore either. I haven't used that for a while.
So I looked to see what they changed.......
These quick example from english > deutsch, deutsch > english work.
curl -s -A "Mozilla" "http://translate.google.com/translate_a/t?client=t&text=I+like+to+read+man+pages&hl=pt-BR&sl=en&tl=de&multires=1&ssel=0&tsel=0&sc=1" | awk -F'"' '{print $2}'
curl -s -A "Mozilla" "http://translate.google.com/translate_a/t?client=t&text=Ich+mag+linux+Es+macht+freiheit&hl=pt-BR&sl=de&tl=en&multires=1&ssel=0&tsel=0&sc=1" | awk -F'"' '{print $2}'
I'm in the U.S. Use your countries google server.
If you want text to voice.
curl -s -A Mozilla "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=I+like+to+read+man+pages" > out.mp3
wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=I+like+to+read+man+pages"
Make yourself a script however you like.
]]>but I just get a blank line
]]>@drcouzelis:
Yes, google is giving out his dictionaries for offline use.
...I'm becoming more and more dependant from google services (i use their calendar, their search engine, their translator, their office apps...) and i don't think this is good.
So i'm trying to regain my independence.
Is machine translation such a resource intensive operation?
I don't know. I imagine it would take a lot of processing, a ton of data stored in a huge database, and extremely specialized software. And that's per language.
I'm hoping the more opinions I throw out the closer we'll get to someone proving me wrong.
]]>...Meanwhile, google is giving out offline translation abilities to smartphones
What do you mean? It's impossible for a phone to translate language. The phone always sends the words to Google, the servers translate it, and it gets sent back to your phone.
Did I miss a major leap in technological capability?
]]>#! /usr/bin/env bash
# Translate text using google. Don't abuse.
# Requires curl, awk, iconv, html2text
# Language are:
# af ar az be bn bg bs ca cub zh-CN zh-TW cs cy da de en en_us en_gb en_au
# el es et eu fa fi fr ga gl gu ht hi hmn hr hu hy is id it iw ja jw ka km
# kn ko la lv lt mk mr ms mt no nl pl pt ro ru sr sk sl sq sw sv ta te th tl
# tr uk ur vi yi
echo "Language options are:"
echo "en de fr es it" # Add languages here.
echo "What input language"
read ILAN
echo "What ouput language"
read OLAN
echo "Enter text"
read TEXT
result=$(curl -s -i --user-agent "" -d "sl=$ILAN" -d "tl=$OLAN" --data-urlencode "text=$TEXT" http://translate.google.com)
encoding=$(awk '/Content-Type: .* charset=/ {sub(/^.*charset=["'\'']?/,""); sub(/[ "'\''].*$/,""); print}' <<<"$result")
iconv -f $encoding <<<"$result" | awk 'BEGIN {RS="</div>"};/<span[^>]* id=["'\'']?result_box["'\'']?/' | html2text
exit
There is Apertium: http://www.apertium.org/
Holy crap, THANKS. I wish I knew about this longer.
]]>...Meanwhile, google is giving out offline translation abilities to smartphones
]]>