Module: GTranslate
- Defined in:
- lib/g_translate.rb,
lib/g_translate/client.rb,
lib/g_translate/translator.rb
Overview
Copyright © 2008 [Cyril David] released under MIT licence
Defined Under Namespace
Classes: Client, InvalidIso_639_2, InvalidSourceText, Translator
Class Method Summary collapse
-
.translate(text, opts = {}) ⇒ Object
Parameters text<String>:: The text you want to be translated opts<Hash>:: An options hash (see below).
Class Method Details
.translate(text, opts = {}) ⇒ Object
Parameters
- text<String>
-
The text you want to be translated
- opts<Hash>
-
An options hash (see below)
Options (opts)
- :from<String>
-
Source language in iso_639_2 format
- :to<String>
-
Target language in iso_639_2 format
Returns
- String
-
the translated text in the language of target
—
24 25 26 27 |
# File 'lib/g_translate.rb', line 24 def self.translate( text, opts = {} ) ( opts ) Translator.new( text, opts[:from], opts[:to] ).translate end |