Google translate ruby client api 0.1

Hi, guys. I wrote a ruby client api fro google translate service, then i
can
get the answer directly from the terminal, instead of the browser.
It’s really convenient for me. Enjoy it, :slight_smile:

Install

sudo gem install rtranslate

Usage

sishen@lifegoo:~$ irb -rubygems
irb(main):001:0> require ‘rtranslate’
=> true
irb(main):002:0> $KCODE = ‘u’
=> “u”
irb(main):003:0> result = Translate.t(“china”, Language::ENGLISH,
Language::CHINESE_SIMPLIFIED)
=> “中国”
irb(main):004:0> result = Translate.t(“china”, Language::ENGLISH,
Language::JAPANESE)
=> “中華人民共和国”
irb(main):005:0> result = Translate.t(“china”, Language::ENGLISH,
“zh-TW”)
=> “中國”

Really very easy to use, I think. And the source is hosting on
http://rtranslate.googlecode.com. Enjoy it.

Quoth sishen:

Usage
Language::JAPANESE)
=> “中華人民共和国”
irb(main):005:0> result = Translate.t(“china”, Language::ENGLISH, “zh-TW”)
=> “中國”

Really very easy to use, I think. And the source is hosting on
http://rtranslate.googlecode.com. Enjoy it.

Very cool. Do you plan on adding a command-line tool as well? That would
make
it even easier to use at a terminal. If you need examples, you could
look at
the (IMO) excellent metadata gem.

Thanks,

a good idea. I’ll do it tonight, :slight_smile:

Comand line tool is ok.

Now you can use rtranslate as below:

$rtranslate -f en -t zh-CN china

Get the gems from http://rtranslate.googlecode.com. Enjoy. :slight_smile:

On Nov 15, 2007 11:48 PM, sishen [email protected] wrote:

LifeGoo.com is for sale | HugeDomains

Hi, guys. I wrote a ruby client api fro google translate service, then i can
get the answer directly from the terminal, instead of the browser.
It’s really convenient for me. Enjoy it, :slight_smile:

I have written similar tools using Watir, but one thing I noticed is
that google
translate doesn’t like you using bots - it hit me with a capcha.

Does this library handle this? Or is it just something that you are
supposed
to use responsibly.

Admittedly I was being an ass about it, and trying to translate all of
my applications
resource files.

As an aside, does anyone know of any online services that allow you
unlimited
(for pay) machine translation?

sorry, personally i haven’t met the problem. It has never asked me to
input
the captcha to go through.
I think maybe your translation is too heavy and have automatically
recognized by the server.

Also, if you still meet the problem with rtranslate, please give me a
feedback and i’ll try to fight with it. :slight_smile:

On Nov 19, 2007 8:30 PM, sishen [email protected] wrote:

sorry, personally i haven’t met the problem. It has never asked me to input
the captcha to go through.
I think maybe your translation is too heavy and have automatically
recognized by the server.

Yeah, it was pretty brutal alright, some java properties files with
~3000 entries.
For Rtranslate, it might be best to have some kind of custom exception
in case
you found it.

Also, if you still meet the problem with rtranslate, please give me a
feedback and i’ll try to fight with it. :slight_smile:

Lol! I would probably stay away from trying to work around
Captcha/Kismet/whatever.

I need google too much for work for them to pile on sanctions…

Quoth sishen:

a good idea. I’ll do it tonight, :slight_smile:

It’s really convenient for me. Enjoy it, :slight_smile:
irb(main):002:0> $KCODE = ‘u’

Thanks,

Konrad M. [email protected] http://konrad.sobertillnoon.com/

Cool, thanks.