Skip to content

Commit 7ca3e49

Browse files
authored
Support Google Cloud Translate V2 gem (#181)
* Update Ruby, change appraisals to contain both GCT versions * Adjust code to enable usage of both V1 and V2 GCT gems * Fixes issue #142 for GCT * Update Readme * Bump to newest Rails minors * Fix Rails 6.1 new translate logic not saving defaults in Lit
1 parent 2042d63 commit 7ca3e49

File tree

16 files changed

+518
-230
lines changed

16 files changed

+518
-230
lines changed

.ruby-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.3
1+
2.7.4

Appraisals

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ appraise 'rails-5.2' do
1616
gem 'rails-controller-testing'
1717
gem 'minitest'
1818
gem 'm', '~> 1.5.0'
19+
gem 'google-cloud-translate', '~> 1.2.4'
1920
end
2021

2122
appraise 'rails-6.0' do
@@ -36,11 +37,12 @@ appraise 'rails-6.0' do
3637
gem 'rails-controller-testing'
3738
gem 'minitest'
3839
gem 'm', '~> 1.5.0'
40+
gem 'google-cloud-translate', '~> 1.2.4'
3941
end
4042

4143
appraise 'rails-6.1' do
4244
source 'https://rubygems.org'
43-
gem 'rails', '~> 6.1.3'
45+
gem 'rails', '~> 6.1.4.1'
4446
gem 'devise'
4547
gem 'pg', '~> 1.2.3'
4648
gem 'redis'
@@ -56,4 +58,5 @@ appraise 'rails-6.1' do
5658
gem 'rails-controller-testing'
5759
gem 'minitest'
5860
gem 'm', '~> 1.5.0'
61+
gem 'google-cloud-translate', '~> 2.1.2'
5962
end

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ Lit::CloudTranslation.provider = Lit::CloudTranslation::Providers::Google
135135
```
136136
gem 'google-cloud-translate', '~> 1.2.4'
137137
```
138+
...we also support V2 of Google Cloud Translate gem, should you need it:
139+
```
140+
gem 'google-cloud-translate', '~> 2.1.2'
141+
```
138142

139143
To use translation via Google, you need to obtain a [service account key](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) containing all the credentials required by the API.
140144

gemfiles/rails_5.2.gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ gem "pry-rails"
1818
gem "rails-controller-testing"
1919
gem "minitest"
2020
gem "m", "~> 1.5.0"
21+
gem "google-cloud-translate", "~> 1.2.4"
2122

2223
gemspec path: "../"

gemfiles/rails_5.2.gemfile.lock

+60-55
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,43 @@ PATH
1111
GEM
1212
remote: https://rubygems.org/
1313
specs:
14-
actioncable (5.2.5)
15-
actionpack (= 5.2.5)
14+
actioncable (5.2.6)
15+
actionpack (= 5.2.6)
1616
nio4r (~> 2.0)
1717
websocket-driver (>= 0.6.1)
18-
actionmailer (5.2.5)
19-
actionpack (= 5.2.5)
20-
actionview (= 5.2.5)
21-
activejob (= 5.2.5)
18+
actionmailer (5.2.6)
19+
actionpack (= 5.2.6)
20+
actionview (= 5.2.6)
21+
activejob (= 5.2.6)
2222
mail (~> 2.5, >= 2.5.4)
2323
rails-dom-testing (~> 2.0)
24-
actionpack (5.2.5)
25-
actionview (= 5.2.5)
26-
activesupport (= 5.2.5)
24+
actionpack (5.2.6)
25+
actionview (= 5.2.6)
26+
activesupport (= 5.2.6)
2727
rack (~> 2.0, >= 2.0.8)
2828
rack-test (>= 0.6.3)
2929
rails-dom-testing (~> 2.0)
3030
rails-html-sanitizer (~> 1.0, >= 1.0.2)
31-
actionview (5.2.5)
32-
activesupport (= 5.2.5)
31+
actionview (5.2.6)
32+
activesupport (= 5.2.6)
3333
builder (~> 3.1)
3434
erubi (~> 1.4)
3535
rails-dom-testing (~> 2.0)
3636
rails-html-sanitizer (~> 1.0, >= 1.0.3)
37-
activejob (5.2.5)
38-
activesupport (= 5.2.5)
37+
activejob (5.2.6)
38+
activesupport (= 5.2.6)
3939
globalid (>= 0.3.6)
40-
activemodel (5.2.5)
41-
activesupport (= 5.2.5)
42-
activerecord (5.2.5)
43-
activemodel (= 5.2.5)
44-
activesupport (= 5.2.5)
40+
activemodel (5.2.6)
41+
activesupport (= 5.2.6)
42+
activerecord (5.2.6)
43+
activemodel (= 5.2.6)
44+
activesupport (= 5.2.6)
4545
arel (>= 9.0)
46-
activestorage (5.2.5)
47-
actionpack (= 5.2.5)
48-
activerecord (= 5.2.5)
46+
activestorage (5.2.6)
47+
actionpack (= 5.2.6)
48+
activerecord (= 5.2.6)
4949
marcel (~> 1.0.0)
50-
activesupport (5.2.5)
50+
activesupport (5.2.6)
5151
concurrent-ruby (~> 1.0, >= 1.0.2)
5252
i18n (>= 0.7, < 2)
5353
minitest (~> 5.1)
@@ -78,7 +78,7 @@ GEM
7878
coffee-script-source
7979
execjs
8080
coffee-script-source (1.12.2)
81-
concurrent-ruby (1.1.8)
81+
concurrent-ruby (1.1.9)
8282
crack (0.4.5)
8383
rexml
8484
crass (1.0.6)
@@ -100,8 +100,8 @@ GEM
100100
faraday (0.17.4)
101101
multipart-post (>= 1.2, < 3)
102102
ffi (1.15.0)
103-
globalid (0.4.2)
104-
activesupport (>= 4.2.0)
103+
globalid (1.0.0)
104+
activesupport (>= 5.0)
105105
google-cloud-core (1.6.0)
106106
google-cloud-env (~> 1.0)
107107
google-cloud-errors (~> 1.0)
@@ -120,39 +120,43 @@ GEM
120120
os (>= 0.9, < 2.0)
121121
signet (~> 0.7)
122122
hashdiff (1.0.1)
123-
i18n (1.8.10)
123+
i18n (1.8.11)
124124
concurrent-ruby (~> 1.0)
125125
jquery-rails (4.4.0)
126126
rails-dom-testing (>= 1, < 3)
127127
railties (>= 4.2.0)
128128
thor (>= 0.14, < 2.0)
129129
jwt (2.2.2)
130-
loofah (2.9.1)
130+
loofah (2.13.0)
131131
crass (~> 1.0.2)
132132
nokogiri (>= 1.5.9)
133133
m (1.5.1)
134134
method_source (>= 0.6.7)
135135
rake (>= 0.9.2.2)
136136
mail (2.7.1)
137137
mini_mime (>= 0.1.1)
138-
marcel (1.0.1)
138+
marcel (1.0.2)
139139
memoist (0.16.2)
140140
method_source (1.0.0)
141-
mini_mime (1.1.0)
141+
mini_mime (1.1.2)
142+
mini_portile2 (2.6.1)
142143
minispec-metadata (2.0.0)
143144
minitest
144-
minitest (5.14.4)
145+
minitest (5.15.0)
145146
minitest-vcr (1.4.0)
146147
minispec-metadata (~> 2.0)
147148
minitest (>= 4.7.5)
148149
vcr (>= 2.9)
149150
mocha (1.12.0)
150151
multi_json (1.15.0)
151152
multipart-post (2.1.1)
152-
nio4r (2.5.7)
153-
nokogiri (1.11.3-x86_64-darwin)
153+
nio4r (2.5.8)
154+
nokogiri (1.12.5)
155+
mini_portile2 (~> 2.6.1)
156+
racc (~> 1.4)
157+
nokogiri (1.12.5-x86_64-darwin)
154158
racc (~> 1.4)
155-
nokogiri (1.11.3-x86_64-linux)
159+
nokogiri (1.12.5-x86_64-linux)
156160
racc (~> 1.4)
157161
orm_adapter (0.5.0)
158162
os (1.1.1)
@@ -166,22 +170,22 @@ GEM
166170
pry-rails (0.3.9)
167171
pry (>= 0.10.4)
168172
public_suffix (4.0.6)
169-
racc (1.5.2)
173+
racc (1.6.0)
170174
rack (2.2.3)
171175
rack-test (1.1.0)
172176
rack (>= 1.0, < 3)
173-
rails (5.2.5)
174-
actioncable (= 5.2.5)
175-
actionmailer (= 5.2.5)
176-
actionpack (= 5.2.5)
177-
actionview (= 5.2.5)
178-
activejob (= 5.2.5)
179-
activemodel (= 5.2.5)
180-
activerecord (= 5.2.5)
181-
activestorage (= 5.2.5)
182-
activesupport (= 5.2.5)
177+
rails (5.2.6)
178+
actioncable (= 5.2.6)
179+
actionmailer (= 5.2.6)
180+
actionpack (= 5.2.6)
181+
actionview (= 5.2.6)
182+
activejob (= 5.2.6)
183+
activemodel (= 5.2.6)
184+
activerecord (= 5.2.6)
185+
activestorage (= 5.2.6)
186+
activesupport (= 5.2.6)
183187
bundler (>= 1.3.0)
184-
railties (= 5.2.5)
188+
railties (= 5.2.6)
185189
sprockets-rails (>= 2.0.0)
186190
rails-controller-testing (1.0.5)
187191
actionpack (>= 5.0.1.rc1)
@@ -190,15 +194,15 @@ GEM
190194
rails-dom-testing (2.0.3)
191195
activesupport (>= 4.2.0)
192196
nokogiri (>= 1.6)
193-
rails-html-sanitizer (1.3.0)
197+
rails-html-sanitizer (1.4.2)
194198
loofah (~> 2.3)
195-
railties (5.2.5)
196-
actionpack (= 5.2.5)
197-
activesupport (= 5.2.5)
199+
railties (5.2.6)
200+
actionpack (= 5.2.6)
201+
activesupport (= 5.2.6)
198202
method_source
199203
rake (>= 0.8.7)
200204
thor (>= 0.19.0, < 2.0)
201-
rake (13.0.3)
205+
rake (13.0.6)
202206
redis (4.2.5)
203207
regexp_parser (2.1.1)
204208
responders (3.0.1)
@@ -223,9 +227,9 @@ GEM
223227
sprockets (4.0.2)
224228
concurrent-ruby (~> 1.0)
225229
rack (> 1, < 3)
226-
sprockets-rails (3.2.2)
227-
actionpack (>= 4.0)
228-
activesupport (>= 4.0)
230+
sprockets-rails (3.4.2)
231+
actionpack (>= 5.2)
232+
activesupport (>= 5.2)
229233
sprockets (>= 3.0.0)
230234
test_declarative (0.0.6)
231235
thor (1.1.0)
@@ -240,13 +244,14 @@ GEM
240244
addressable (>= 2.3.6)
241245
crack (>= 0.3.2)
242246
hashdiff (>= 0.4.0, < 2.0.0)
243-
websocket-driver (0.7.3)
247+
websocket-driver (0.7.5)
244248
websocket-extensions (>= 0.1.0)
245249
websocket-extensions (0.1.5)
246250
xpath (3.2.0)
247251
nokogiri (~> 1.8)
248252

249253
PLATFORMS
254+
ruby
250255
x86_64-darwin-20
251256
x86_64-linux
252257

@@ -275,4 +280,4 @@ DEPENDENCIES
275280
webmock
276281

277282
BUNDLED WITH
278-
2.2.16
283+
2.2.25

gemfiles/rails_6.0.gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ gem "pry-rails"
1818
gem "rails-controller-testing"
1919
gem "minitest"
2020
gem "m", "~> 1.5.0"
21+
gem "google-cloud-translate", "~> 1.2.4"
2122

2223
gemspec path: "../"

0 commit comments

Comments
 (0)