y-translate 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/y/translate/version.rb +1 -1
- data/lib/y/translate.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a29b94ecb2d7047dd80e9f94ffaba43b4f598431
|
4
|
+
data.tar.gz: 3e68e7d2db763e0197bd3a4047c4e620fdc50b02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aa558f27d341dea7f9a2252451b18c1092231ce54d3a99f65497f3103960234c2bca636a4b6be705c46eed8085028dd6b23d5d9674828691b14c5be651e769b
|
7
|
+
data.tar.gz: 8ea04832972b9ad8db04bb3ef42e3899b98abd5b8f46c19a2c5ecf5e8d299c95df85cbdd3a1e2e6fa81efc28b446c88dcec6bc2a8f9524e2c082a507da0125ce
|
data/lib/y/translate/version.rb
CHANGED
data/lib/y/translate.rb
CHANGED
@@ -28,14 +28,14 @@ module Y
|
|
28
28
|
def self.get_langs
|
29
29
|
request(
|
30
30
|
API::METHOD_GET_LANGS,
|
31
|
-
ui:
|
31
|
+
ui: configuration.lang_to
|
32
32
|
)['dirs']
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.get_langs_names
|
36
36
|
request(
|
37
37
|
API::METHOD_GET_LANGS,
|
38
|
-
ui:
|
38
|
+
ui: configuration.lang_to
|
39
39
|
)['langs']
|
40
40
|
end
|
41
41
|
|
@@ -45,7 +45,7 @@ module Y
|
|
45
45
|
|
46
46
|
def self.translate(text, params = {})
|
47
47
|
params[:text] = text
|
48
|
-
params[:lang] =
|
48
|
+
params[:lang] = configuration.lang_to unless params.key?(:lang)
|
49
49
|
response = request(API::METHOD_TRANSLATE, params)['text']
|
50
50
|
response = response[0] if response.count == 1
|
51
51
|
response
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: y-translate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Voronov Dmitry
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|