Class: Translatomatic::Provider::GoogleWeb
- Defined in:
- lib/translatomatic/provider/google_web.rb
Overview
Google translation web interface. supports multiple translations
Instance Attribute Summary collapse
-
#dt ⇒ Object
Returns the value of attribute dt.
Attributes inherited from Base
Class Method Summary collapse
-
.supports_alternative_translations? ⇒ boolean
True if a string can have alternative translations.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ GoogleWeb
constructor
Create a new GoogleWeb provider instance.
-
#languages ⇒ Array<String>
A list of languages supported by this provider.
Methods inherited from Base
#name, supports_no_translate_html?, #to_s, #translate
Constructor Details
#initialize(options = {}) ⇒ GoogleWeb
Create a new GoogleWeb provider instance
15 16 17 18 19 20 |
# File 'lib/translatomatic/provider/google_web.rb', line 15 def initialize( = {}) super() require 'google_web_translate' @dt = %w[t at] @debug = [:debug] end |
Instance Attribute Details
#dt ⇒ Object
Returns the value of attribute dt.
7 8 9 |
# File 'lib/translatomatic/provider/google_web.rb', line 7 def dt @dt end |
Class Method Details
.supports_alternative_translations? ⇒ boolean
Returns True if a string can have alternative translations.
10 11 12 |
# File 'lib/translatomatic/provider/google_web.rb', line 10 def self.supports_alternative_translations? true end |
Instance Method Details
#languages ⇒ Array<String>
Returns A list of languages supported by this provider.
23 24 25 |
# File 'lib/translatomatic/provider/google_web.rb', line 23 def languages api.respond_to?(:languages) ? api.languages : [] end |