crutch-google_translate 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/google_translate.rb +1 -0
- data/lib/google_translate/translator.rb +2 -2
- metadata +3 -2
data/VERSION.yml
CHANGED
data/lib/google_translate.rb
CHANGED
@@ -23,9 +23,9 @@ module GoogleTranslate
|
|
23
23
|
# then this option needs to have a true value (:html => true)
|
24
24
|
def translate(text,options = {})
|
25
25
|
PARAMS["langpair"] = "#{@from}%7C#{@to}"
|
26
|
-
PARAMS["q"] = CGI.escape(text)
|
26
|
+
PARAMS["q"] = CGI.escape(text[0,GOOGLE_STRING_LIMIT])
|
27
27
|
response = google_api_call(SERVICE, PARAMS, TranslationResponse)
|
28
|
-
translation = options[:html] ? response.translation : CGI.unescapeHTML(response.translation)
|
28
|
+
translation = options[:html].nil? ? response.translation : CGI.unescapeHTML(response.translation)
|
29
29
|
translation # return value
|
30
30
|
end
|
31
31
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crutch-google_translate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elise Huard
|
@@ -37,6 +37,7 @@ files:
|
|
37
37
|
- spec/translate_spec.rb
|
38
38
|
has_rdoc: true
|
39
39
|
homepage: http://github.com/crutch/google_translate
|
40
|
+
licenses:
|
40
41
|
post_install_message:
|
41
42
|
rdoc_options:
|
42
43
|
- --inline-source
|
@@ -58,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
59
|
requirements: []
|
59
60
|
|
60
61
|
rubyforge_project:
|
61
|
-
rubygems_version: 1.
|
62
|
+
rubygems_version: 1.3.5
|
62
63
|
signing_key:
|
63
64
|
specification_version: 2
|
64
65
|
summary: Google Translate Ruby API
|