Module: Translate

Defined in:
lib/rtranslate/detection.rb,
lib/rtranslate/rtranslate.rb

Overview

The program is a simple, unofficial, ruby client API for using Google Translate.

Author

Dingding Ye ([email protected])

Copyright

Copyright © 2007 Dingding Ye

License

Distributes under MIT License

Defined Under Namespace

Classes: Detection, DetectionResponse, RTranslate, UnsupportedLanguagePair

Class Method Summary collapse

Class Method Details

.d(text) ⇒ Object



23
24
25
26
27
# File 'lib/rtranslate.rb', line 23

def Translate.d(text)
  Detection.detect(text)
rescue
  "Error: " + $!
end

.t(text, from, to) ⇒ Object



17
18
19
20
21
# File 'lib/rtranslate.rb', line 17

def Translate.t(text, from, to)
  RTranslate.translate(text, from, to)
rescue
  "Error: " + $!
end