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



27
28
29
30
31
# File 'lib/rtranslate.rb', line 27

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

.t(text, from, to, options = {}) ⇒ Object



21
22
23
24
25
# File 'lib/rtranslate.rb', line 21

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