Class: TranexpTranslate

Inherits:
TranslatorBase show all
Defined in:
lib/translators/tranexp_translate.rb

Instance Method Summary collapse

Methods inherited from TranslatorBase

response_time

Instance Method Details

#translate(text, source, destination) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/translators/tranexp_translate.rb', line 5

def translate(text, source, destination)
  result = text
  begin
    tran_source = eval("Tranexp::Http::#{$ottra_languages[source]}")
    tran_dest = eval("Tranexp::Http::#{$ottra_languages[source]}")
    tranexp = Tranexp::Http.new
    result = tranexp.translate(text, tran_source, tran_dest)
  rescue
    # just do nothing
  ensure
    return result
  end
end