tr4n5l4te 0.1.12 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +14 -0
- data/Gemfile.lock +15 -15
- data/README.md +2 -1
- data/lib/tr4n5l4te/agent.rb +1 -1
- data/lib/tr4n5l4te/translator.rb +11 -0
- data/lib/tr4n5l4te/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3dda30bbbab77606fb695bb5a421573593634afb097d1cfc92b8c8c834a56fb
|
4
|
+
data.tar.gz: f28aa0c79e926f8b2b984eb6a210861fdad47b474143814d0e077ccf054d021f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 624c2b0d858ca5ddd4e2fef380119e93c1ae2664a45a0f17fdd520e38c37606db1b2ec38169cd9a01e93c11df6a899463209c9f795cec886e989b0c0528a8074
|
7
|
+
data.tar.gz: 75b7fa155f1594ff19bc791fd1c71c77b391922e5ab24c794ccc4bdf824a9adc36898c2ee80a786cda1fef11d4e0bbf6c0f9c05e4faa38e90fd54354135f6491
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
*0.1.15* (September 06, 2022)
|
2
|
+
|
3
|
+
* Upgrade Rack and Nokogiri
|
4
|
+
|
5
|
+
*0.1.14* (June 07, 2021)
|
6
|
+
|
7
|
+
* Add workaround for phantomjs SSL handshake problem, issue #24 - SSL handshake failed, by @gahia - see also: "https://github.com/ariya/phantomjs/issues/12440"
|
8
|
+
* Look for and report non-neutral gender translations. Now accepts the "male" translation by default and warns that there are alternatives, by @gahia.
|
9
|
+
* Don't fail if a translation is not found but instead show a warning message and continue, by @gahia.
|
10
|
+
|
11
|
+
*0.1.13* (April 30, 2021)
|
12
|
+
|
13
|
+
* Upgrade rexml from 3.2.4 to 3.2.5 to fix a CVE
|
14
|
+
|
1
15
|
*0.1.12* (March 11, 2021)
|
2
16
|
|
3
17
|
* Dump console message into oblivion, do we don't see stupid warning messages like "Using this console may allow attackers to impersonate you and steal your information using an attack called Self-XSS"
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tr4n5l4te (0.1.
|
4
|
+
tr4n5l4te (0.1.15)
|
5
5
|
capybara (~> 2.6)
|
6
6
|
colored (~> 1)
|
7
7
|
midwire_common (~> 0.1)
|
@@ -11,8 +11,8 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
addressable (2.
|
15
|
-
public_suffix (>= 2.0.2, <
|
14
|
+
addressable (2.8.1)
|
15
|
+
public_suffix (>= 2.0.2, < 6.0)
|
16
16
|
ast (2.4.2)
|
17
17
|
capybara (2.18.0)
|
18
18
|
addressable
|
@@ -29,10 +29,10 @@ GEM
|
|
29
29
|
method_source (0.9.2)
|
30
30
|
midwire_common (0.3.0)
|
31
31
|
thor (~> 0.19)
|
32
|
-
mini_mime (1.
|
33
|
-
mini_portile2 (2.
|
34
|
-
nokogiri (1.
|
35
|
-
mini_portile2 (~> 2.
|
32
|
+
mini_mime (1.1.2)
|
33
|
+
mini_portile2 (2.8.0)
|
34
|
+
nokogiri (1.13.8)
|
35
|
+
mini_portile2 (~> 2.8.0)
|
36
36
|
racc (~> 1.4)
|
37
37
|
optimist (3.0.1)
|
38
38
|
parallel (1.20.1)
|
@@ -47,15 +47,15 @@ GEM
|
|
47
47
|
method_source (~> 0.9.0)
|
48
48
|
pry-nav (0.3.0)
|
49
49
|
pry (>= 0.9.10, < 0.13.0)
|
50
|
-
public_suffix (
|
51
|
-
racc (1.
|
52
|
-
rack (2.2.
|
53
|
-
rack-test (
|
54
|
-
rack (>= 1.
|
50
|
+
public_suffix (5.0.0)
|
51
|
+
racc (1.6.0)
|
52
|
+
rack (2.2.4)
|
53
|
+
rack-test (2.0.2)
|
54
|
+
rack (>= 1.3)
|
55
55
|
rainbow (3.0.0)
|
56
56
|
rake (13.0.3)
|
57
57
|
regexp_parser (2.1.1)
|
58
|
-
rexml (3.2.
|
58
|
+
rexml (3.2.5)
|
59
59
|
rspec (3.10.0)
|
60
60
|
rspec-core (~> 3.10.0)
|
61
61
|
rspec-expectations (~> 3.10.0)
|
@@ -89,7 +89,7 @@ GEM
|
|
89
89
|
simplecov_json_formatter (0.1.2)
|
90
90
|
thor (0.20.3)
|
91
91
|
unicode-display_width (2.0.0)
|
92
|
-
websocket-driver (0.7.
|
92
|
+
websocket-driver (0.7.5)
|
93
93
|
websocket-extensions (>= 0.1.0)
|
94
94
|
websocket-extensions (0.1.5)
|
95
95
|
xpath (3.2.0)
|
@@ -108,4 +108,4 @@ DEPENDENCIES
|
|
108
108
|
tr4n5l4te!
|
109
109
|
|
110
110
|
BUNDLED WITH
|
111
|
-
2.
|
111
|
+
2.2.32
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Tr4n5l4te
|
2
2
|
|
3
|
-
**Version: 0.1.
|
3
|
+
**Version: 0.1.15**
|
4
4
|
|
5
5
|
Use Google Translate without an API key.
|
6
6
|
|
@@ -93,6 +93,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/midwir
|
|
93
93
|
Thanks to all of those who contribute!
|
94
94
|
|
95
95
|
* @kirylpl - Fixed phantomjs selector, migration to Optimist gem
|
96
|
+
* @gahia - Fixed phantomjs SSL handshake problem, Look for and report non-neutral gender translations. Now accepts the "male" translation by default and warns that there are alternatives, Don't fail if a translation is not found but instead show a warning message and continue.
|
96
97
|
|
97
98
|
## License
|
98
99
|
|
data/lib/tr4n5l4te/agent.rb
CHANGED
@@ -10,7 +10,7 @@ module Tr4n5l4te
|
|
10
10
|
app,
|
11
11
|
js_errors: false,
|
12
12
|
timeout: Tr4n5l4te.configuration.timeout,
|
13
|
-
phantomjs_options: ['--load-images=no', '--ignore-ssl-errors=yes', '--web-security=false'],
|
13
|
+
phantomjs_options: ['--load-images=no', '--ignore-ssl-errors=yes', '--web-security=false', '--ssl-protocol=any'],
|
14
14
|
phantomjs_logger: StringIO.new,
|
15
15
|
logger: StringIO.new
|
16
16
|
)
|
data/lib/tr4n5l4te/translator.rb
CHANGED
@@ -20,11 +20,22 @@ module Tr4n5l4te
|
|
20
20
|
smart_visit(translator_url(encoded_text, from_lang, to_lang))
|
21
21
|
result_box = browser.find('.JLqJ4b.ChMk0b > span:first-child')
|
22
22
|
postprocess(result_box.text)
|
23
|
+
|
23
24
|
rescue Capybara::Ambiguous
|
24
25
|
all_translations = browser.find_all('.JLqJ4b.ChMk0b > span:first-child')
|
25
26
|
multiples = all_translations.collect(&:text)
|
26
27
|
puts("WARNING: '#{text}' has multiple translations: [#{multiples.join(', ')}]")
|
27
28
|
text
|
29
|
+
|
30
|
+
rescue Capybara::ElementNotFound
|
31
|
+
all_translations = browser.find_all('.J0lOec > span:first-child')
|
32
|
+
multiples = all_translations.collect(&:text)
|
33
|
+
if multiples.any?
|
34
|
+
puts("WARNING: '#{text}' has gender translations: [#{multiples.join(', ')}]")
|
35
|
+
postprocess(multiples.last) # take the male form
|
36
|
+
else
|
37
|
+
puts("WARNING: Could not find a translation for '#{text}'")
|
38
|
+
end
|
28
39
|
end
|
29
40
|
|
30
41
|
private
|
data/lib/tr4n5l4te/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tr4n5l4te
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Blackburn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
218
|
- !ruby/object:Gem::Version
|
219
219
|
version: '0'
|
220
220
|
requirements: []
|
221
|
-
rubygems_version: 3.
|
221
|
+
rubygems_version: 3.2.32
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
224
|
summary: Use Google Translate without an API key.
|