translation_engine 0.0.7 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +5 -5
  2. data/{test/dummy/tmp/cache/assets/development/sprockets/25e260f6a1dc0c4484c200da624af92e → app/assets/javascripts/translation_engine/html2canvas.js} +0 -0
  3. data/app/assets/javascripts/translation_engine/screenshots.js.coffee +1 -1
  4. data/app/middlewares/translation_engine/catcher_middleware.rb +5 -3
  5. data/app/models/translation_engine/backend.rb +2 -2
  6. data/lib/tasks/translation_engine_tasks.rake +5 -5
  7. data/lib/translation_engine/engine.rb +0 -2
  8. data/lib/translation_engine/version.rb +1 -1
  9. metadata +9 -99
  10. data/test/dummy/db/development.sqlite3 +0 -0
  11. data/test/dummy/db/test.sqlite3 +0 -0
  12. data/test/dummy/log/development.log +0 -20917
  13. data/test/dummy/log/test.log +0 -13
  14. data/test/dummy/tmp/cache/assets/development/sprockets/00744134f1b8c820c724a9d6207f3a7a +0 -0
  15. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  16. data/test/dummy/tmp/cache/assets/development/sprockets/2c59dca85b9e8c86af73e35e031fbbdc +0 -0
  17. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  18. data/test/dummy/tmp/cache/assets/development/sprockets/3065ce12758c77c2a4921568b7e742a0 +0 -0
  19. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  20. data/test/dummy/tmp/cache/assets/development/sprockets/379aa3c595d4aa45885d1db5fbcb6e3a +0 -0
  21. data/test/dummy/tmp/cache/assets/development/sprockets/3824972f4a7973916302b2649b498d5c +0 -0
  22. data/test/dummy/tmp/cache/assets/development/sprockets/3c856723c34a3a47f181661bc3499592 +0 -0
  23. data/test/dummy/tmp/cache/assets/development/sprockets/41448ad2a85326b721f1e060b86dc3dc +0 -0
  24. data/test/dummy/tmp/cache/assets/development/sprockets/4387b22d35f85d5eb8336a8ed1381c5c +0 -0
  25. data/test/dummy/tmp/cache/assets/development/sprockets/48388ecb825f9d2b3ac4af78175993b2 +0 -0
  26. data/test/dummy/tmp/cache/assets/development/sprockets/55588f5ab129d88af0eef8e14f0f57aa +0 -0
  27. data/test/dummy/tmp/cache/assets/development/sprockets/6c9de7f2c8ef919141331199520c6890 +0 -0
  28. data/test/dummy/tmp/cache/assets/development/sprockets/6ef9396e711eaa215cf2fee6f0102551 +0 -0
  29. data/test/dummy/tmp/cache/assets/development/sprockets/7c8b616251089af5cf0b4bddc02c2cf1 +0 -0
  30. data/test/dummy/tmp/cache/assets/development/sprockets/83e8ae6039d56661189e1fb4812c89f0 +0 -0
  31. data/test/dummy/tmp/cache/assets/development/sprockets/91ae3870a5845130aa888fbe093d1554 +0 -0
  32. data/test/dummy/tmp/cache/assets/development/sprockets/9b474687caa91b30ec2214bdd9f54f33 +0 -0
  33. data/test/dummy/tmp/cache/assets/development/sprockets/b6c894a4da0fd8d4cd152a353d826045 +0 -0
  34. data/test/dummy/tmp/cache/assets/development/sprockets/c17e2e13afcf1d3570e8a857ccede2c1 +0 -0
  35. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  36. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  37. data/test/dummy/tmp/cache/assets/development/sprockets/efb95a602af8237a4970b7c683dae187 +0 -0
  38. data/test/dummy/tmp/cache/assets/development/sprockets/f603eeacf1822560ceb9ac4102ff8430 +0 -0
  39. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  40. data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  41. data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  42. data/test/dummy/tmp/cache/assets/test/sprockets/48388ecb825f9d2b3ac4af78175993b2 +0 -0
  43. data/test/dummy/tmp/cache/assets/test/sprockets/7c8b616251089af5cf0b4bddc02c2cf1 +0 -0
  44. data/test/dummy/tmp/cache/assets/test/sprockets/83e8ae6039d56661189e1fb4812c89f0 +0 -0
  45. data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  46. data/test/dummy/tmp/cache/assets/test/sprockets/efb95a602af8237a4970b7c683dae187 +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9fe1fe423c1d6f03f4ae78c9844c6a3d323145aa
4
- data.tar.gz: 587f1400dc639320918de9d263eba5f64882e9a0
2
+ SHA256:
3
+ metadata.gz: 56c507d1510239faa143eebb8ee3fc350838b89e752ade64eabb2eb29ba744d4
4
+ data.tar.gz: ed3aa9700cf740cffe558a81760cb589f53312bb89a1ef42174aa6d57e45ff6c
5
5
  SHA512:
6
- metadata.gz: b9700d616cbd5d57b8c87a6a56111f15e2641c03ed8e7783ad324df5592ff597304356c98209a4f7e4e7590b01ad1e1f2331b56d05fe6a8dbbc9d7018aa39c56
7
- data.tar.gz: 72b45e1e4728d1d6af962047bb8ca9794b849dad7bacd59e45a8332b5a600eaa956fd0cd2028497ec1f83553d26b07a73f44228f8795880b6bd5a20877af32b4
6
+ metadata.gz: 3dffd883dd889cb1125f96fd018c8466cb761f96eceadbd40fc7d37df2cfa4554a27d574db43e3de6845cc68d6e194375656fa7feeffb9f26494174ed7c4e2fc
7
+ data.tar.gz: ce760583ae6c6e176950e7b230be2ee66d4054c3992dd3661d85fb77dead5d3412fc43ab208e61323f5d7949e0af9618df927d22f38303a6f878a8e93c2bab12
@@ -1,4 +1,4 @@
1
- #= require html2canvas
1
+ #= require ./html2canvas
2
2
 
3
3
  class TranslationEngine
4
4
 
@@ -10,7 +10,7 @@ module TranslationEngine
10
10
  end
11
11
 
12
12
  def call(env)
13
- if TranslationEngine.use_catcher
13
+ if TranslationEngine.use_catcher && !assets_request?(env)
14
14
  call_catcher(env)
15
15
  else
16
16
  @app.call(env)
@@ -27,7 +27,7 @@ module TranslationEngine
27
27
  end
28
28
 
29
29
  begin
30
- update_translations unless assets_request?(env)
30
+ update_translations
31
31
  rescue StandardError => e
32
32
  puts "Unable to update translations #{e.class} #{e.message}"
33
33
  end
@@ -46,7 +46,9 @@ module TranslationEngine
46
46
  end
47
47
 
48
48
  def assets_request?(env)
49
- env['PATH_INFO'] =~ /\/assets/
49
+ env['PATH_INFO'] =~ /\/assets/ || # AssetPipeline
50
+ env['PATH_INFO'] =~ /\/rails\/active_storage/ || # ActiveStorage
51
+ env['PATH_INFO'] =~ /\/attachments/ # Refile
50
52
  end
51
53
 
52
54
  def params(env)
@@ -56,10 +56,10 @@ class TranslationEngine::Backend < I18n::Backend::Simple
56
56
  result = catch(:exception) do
57
57
  case subject
58
58
  when Symbol
59
- I18n.translate(subject, options.merge(:locale => locale, :throw => true))
59
+ I18n.translate(subject, **options.merge(:locale => locale, :throw => true))
60
60
  when Proc
61
61
  date_or_time = options.delete(:object) || object
62
- resolve(locale, object, subject.call(date_or_time, options))
62
+ resolve(locale, object, subject.call(date_or_time, **options))
63
63
  when nil
64
64
  nil
65
65
  else
@@ -64,18 +64,18 @@ namespace :translation_engine do
64
64
  unless file.include?('faker')
65
65
  hash = YAML.load_file(file) || {}
66
66
  to_dotted_hash(hash).each do |keys, text|
67
- Translation.catch text, keys
67
+ TranslationEngine::Translation.catch text, keys
68
68
  end
69
69
  end
70
70
  end
71
71
 
72
- if Translation.catched.any?
72
+ if TranslationEngine::Translation.catched.any?
73
73
  data = {
74
74
  locale: locale,
75
- translations: Translation.catched.uniq
75
+ translations: TranslationEngine::Translation.catched.uniq
76
76
  }
77
- puts "Send #{Translation.catched.size} translations"
78
- Connection.new.send_translations(data)
77
+ puts "Send #{TranslationEngine::Translation.catched.size} translations"
78
+ TranslationEngine::Connection.new.send_translations(data)
79
79
  else
80
80
  puts "No translations was found and send"
81
81
  end
@@ -1,5 +1,3 @@
1
- require 'rails-assets-html2canvas'
2
-
3
1
  module TranslationEngine
4
2
  class Engine < ::Rails::Engine
5
3
  isolate_namespace TranslationEngine
@@ -1,3 +1,3 @@
1
1
  module TranslationEngine
2
- VERSION = "0.0.7"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: translation_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondrej Bartas
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-20 00:00:00.000000000 Z
11
+ date: 2022-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rails-assets-html2canvas
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: sqlite3
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -103,6 +89,7 @@ extra_rdoc_files: []
103
89
  files:
104
90
  - MIT-LICENSE
105
91
  - Rakefile
92
+ - app/assets/javascripts/translation_engine/html2canvas.js
106
93
  - app/assets/javascripts/translation_engine/screenshots.js.coffee
107
94
  - app/assets/stylesheets/translation_engine/screenshots.css
108
95
  - app/middlewares/translation_engine/catcher_middleware.rb
@@ -158,56 +145,18 @@ files:
158
145
  - test/dummy/config/locales/en.yml
159
146
  - test/dummy/config/routes.rb
160
147
  - test/dummy/config/secrets.yml
161
- - test/dummy/db/development.sqlite3
162
- - test/dummy/db/test.sqlite3
163
- - test/dummy/log/development.log
164
- - test/dummy/log/test.log
165
148
  - test/dummy/public/404.html
166
149
  - test/dummy/public/422.html
167
150
  - test/dummy/public/500.html
168
151
  - test/dummy/public/favicon.ico
169
152
  - test/dummy/test/controllers/root_controller_test.rb
170
- - test/dummy/tmp/cache/assets/development/sprockets/00744134f1b8c820c724a9d6207f3a7a
171
- - test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705
172
- - test/dummy/tmp/cache/assets/development/sprockets/25e260f6a1dc0c4484c200da624af92e
173
- - test/dummy/tmp/cache/assets/development/sprockets/2c59dca85b9e8c86af73e35e031fbbdc
174
- - test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af
175
- - test/dummy/tmp/cache/assets/development/sprockets/3065ce12758c77c2a4921568b7e742a0
176
- - test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953
177
- - test/dummy/tmp/cache/assets/development/sprockets/379aa3c595d4aa45885d1db5fbcb6e3a
178
- - test/dummy/tmp/cache/assets/development/sprockets/3824972f4a7973916302b2649b498d5c
179
- - test/dummy/tmp/cache/assets/development/sprockets/3c856723c34a3a47f181661bc3499592
180
- - test/dummy/tmp/cache/assets/development/sprockets/41448ad2a85326b721f1e060b86dc3dc
181
- - test/dummy/tmp/cache/assets/development/sprockets/4387b22d35f85d5eb8336a8ed1381c5c
182
- - test/dummy/tmp/cache/assets/development/sprockets/48388ecb825f9d2b3ac4af78175993b2
183
- - test/dummy/tmp/cache/assets/development/sprockets/55588f5ab129d88af0eef8e14f0f57aa
184
- - test/dummy/tmp/cache/assets/development/sprockets/6c9de7f2c8ef919141331199520c6890
185
- - test/dummy/tmp/cache/assets/development/sprockets/6ef9396e711eaa215cf2fee6f0102551
186
- - test/dummy/tmp/cache/assets/development/sprockets/7c8b616251089af5cf0b4bddc02c2cf1
187
- - test/dummy/tmp/cache/assets/development/sprockets/83e8ae6039d56661189e1fb4812c89f0
188
- - test/dummy/tmp/cache/assets/development/sprockets/91ae3870a5845130aa888fbe093d1554
189
- - test/dummy/tmp/cache/assets/development/sprockets/9b474687caa91b30ec2214bdd9f54f33
190
- - test/dummy/tmp/cache/assets/development/sprockets/b6c894a4da0fd8d4cd152a353d826045
191
- - test/dummy/tmp/cache/assets/development/sprockets/c17e2e13afcf1d3570e8a857ccede2c1
192
- - test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994
193
- - test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6
194
- - test/dummy/tmp/cache/assets/development/sprockets/efb95a602af8237a4970b7c683dae187
195
- - test/dummy/tmp/cache/assets/development/sprockets/f603eeacf1822560ceb9ac4102ff8430
196
- - test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655
197
- - test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705
198
- - test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953
199
- - test/dummy/tmp/cache/assets/test/sprockets/48388ecb825f9d2b3ac4af78175993b2
200
- - test/dummy/tmp/cache/assets/test/sprockets/7c8b616251089af5cf0b4bddc02c2cf1
201
- - test/dummy/tmp/cache/assets/test/sprockets/83e8ae6039d56661189e1fb4812c89f0
202
- - test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6
203
- - test/dummy/tmp/cache/assets/test/sprockets/efb95a602af8237a4970b7c683dae187
204
153
  - test/test_helper.rb
205
154
  - test/translation_engine_test.rb
206
155
  homepage: http://blueberry.cz
207
156
  licenses:
208
157
  - MIT
209
158
  metadata: {}
210
- post_install_message:
159
+ post_install_message:
211
160
  rdoc_options: []
212
161
  require_paths:
213
162
  - lib
@@ -222,12 +171,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
171
  - !ruby/object:Gem::Version
223
172
  version: '0'
224
173
  requirements: []
225
- rubyforge_project:
226
- rubygems_version: 2.5.1
227
- signing_key:
174
+ rubygems_version: 3.3.7
175
+ signing_key:
228
176
  specification_version: 4
229
177
  summary: Connects Rails application to Translation Server
230
178
  test_files:
179
+ - test/dummy/README.rdoc
180
+ - test/dummy/Rakefile
231
181
  - test/dummy/app/assets/javascripts/application.js
232
182
  - test/dummy/app/assets/javascripts/root.js
233
183
  - test/dummy/app/assets/stylesheets/application.css
@@ -262,50 +212,10 @@ test_files:
262
212
  - test/dummy/config/routes.rb
263
213
  - test/dummy/config/secrets.yml
264
214
  - test/dummy/config.ru
265
- - test/dummy/db/development.sqlite3
266
- - test/dummy/db/test.sqlite3
267
- - test/dummy/log/development.log
268
- - test/dummy/log/test.log
269
215
  - test/dummy/public/404.html
270
216
  - test/dummy/public/422.html
271
217
  - test/dummy/public/500.html
272
218
  - test/dummy/public/favicon.ico
273
- - test/dummy/Rakefile
274
- - test/dummy/README.rdoc
275
219
  - test/dummy/test/controllers/root_controller_test.rb
276
- - test/dummy/tmp/cache/assets/development/sprockets/00744134f1b8c820c724a9d6207f3a7a
277
- - test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705
278
- - test/dummy/tmp/cache/assets/development/sprockets/25e260f6a1dc0c4484c200da624af92e
279
- - test/dummy/tmp/cache/assets/development/sprockets/2c59dca85b9e8c86af73e35e031fbbdc
280
- - test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af
281
- - test/dummy/tmp/cache/assets/development/sprockets/3065ce12758c77c2a4921568b7e742a0
282
- - test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953
283
- - test/dummy/tmp/cache/assets/development/sprockets/379aa3c595d4aa45885d1db5fbcb6e3a
284
- - test/dummy/tmp/cache/assets/development/sprockets/3824972f4a7973916302b2649b498d5c
285
- - test/dummy/tmp/cache/assets/development/sprockets/3c856723c34a3a47f181661bc3499592
286
- - test/dummy/tmp/cache/assets/development/sprockets/41448ad2a85326b721f1e060b86dc3dc
287
- - test/dummy/tmp/cache/assets/development/sprockets/4387b22d35f85d5eb8336a8ed1381c5c
288
- - test/dummy/tmp/cache/assets/development/sprockets/48388ecb825f9d2b3ac4af78175993b2
289
- - test/dummy/tmp/cache/assets/development/sprockets/55588f5ab129d88af0eef8e14f0f57aa
290
- - test/dummy/tmp/cache/assets/development/sprockets/6c9de7f2c8ef919141331199520c6890
291
- - test/dummy/tmp/cache/assets/development/sprockets/6ef9396e711eaa215cf2fee6f0102551
292
- - test/dummy/tmp/cache/assets/development/sprockets/7c8b616251089af5cf0b4bddc02c2cf1
293
- - test/dummy/tmp/cache/assets/development/sprockets/83e8ae6039d56661189e1fb4812c89f0
294
- - test/dummy/tmp/cache/assets/development/sprockets/91ae3870a5845130aa888fbe093d1554
295
- - test/dummy/tmp/cache/assets/development/sprockets/9b474687caa91b30ec2214bdd9f54f33
296
- - test/dummy/tmp/cache/assets/development/sprockets/b6c894a4da0fd8d4cd152a353d826045
297
- - test/dummy/tmp/cache/assets/development/sprockets/c17e2e13afcf1d3570e8a857ccede2c1
298
- - test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994
299
- - test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6
300
- - test/dummy/tmp/cache/assets/development/sprockets/efb95a602af8237a4970b7c683dae187
301
- - test/dummy/tmp/cache/assets/development/sprockets/f603eeacf1822560ceb9ac4102ff8430
302
- - test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655
303
- - test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705
304
- - test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953
305
- - test/dummy/tmp/cache/assets/test/sprockets/48388ecb825f9d2b3ac4af78175993b2
306
- - test/dummy/tmp/cache/assets/test/sprockets/7c8b616251089af5cf0b4bddc02c2cf1
307
- - test/dummy/tmp/cache/assets/test/sprockets/83e8ae6039d56661189e1fb4812c89f0
308
- - test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6
309
- - test/dummy/tmp/cache/assets/test/sprockets/efb95a602af8237a4970b7c683dae187
310
220
  - test/test_helper.rb
311
221
  - test/translation_engine_test.rb
File without changes
File without changes