tolk 4.0.1 → 4.2.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.
- checksums.yaml +4 -4
- data/app/models/tolk/locale.rb +19 -11
- data/app/views/tolk/{_blank_canva.svg → _blank_canva.html.erb} +0 -0
- data/app/views/tolk/{_empty.svg → _empty.html.erb} +0 -0
- data/app/views/tolk/{_houra.svg → _houra.html.erb} +0 -0
- data/app/views/tolk/{_no_data.svg → _no_data.html.erb} +0 -0
- data/app/views/tolk/locales/all.html.erb +1 -1
- data/app/views/tolk/locales/index.html.erb +1 -1
- data/app/views/tolk/locales/show.html.erb +1 -1
- data/app/views/tolk/searches/show.html.erb +1 -1
- data/lib/tolk/pagination.rb +1 -1
- data/lib/tolk/version.rb +1 -1
- metadata +51 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0efb83ba668b7ce45dd8416a130ca95005466ca091664aed126905ba70e07031
|
4
|
+
data.tar.gz: 50bd892173a79fcf5f520600308a2726a0c724e89c7c6ec04f8938bbaae5d084
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab3b4d111fc73221f2c8e911e0c5fb7cdfe9a3fdb74d3de4dda3b750761b0e7fc2395358855eb18e76da8911f37351fc5298638a986229835518d436154030cb
|
7
|
+
data.tar.gz: bf73bddbb7e574ef04041cee9375e4db0d460680a891b0fc2b24fbbd3bdf84b643afbadb8dd793543d051c65396ccf5b483f1250fb258aea084d2110d61966d1
|
data/app/models/tolk/locale.rb
CHANGED
@@ -107,7 +107,9 @@ module Tolk
|
|
107
107
|
phrases = phrases.where('tolk_phrases.id NOT IN (?)', existing_ids) if existing_ids.present?
|
108
108
|
|
109
109
|
result = phrases.public_send(pagination_method, page)
|
110
|
-
if Rails.version
|
110
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('7')
|
111
|
+
ActiveRecord::Associations::Preloader.new(records: result, associations: :translations).call
|
112
|
+
elsif Rails.version =~ /^4\.0/
|
111
113
|
ActiveRecord::Associations::Preloader.new result, :translations
|
112
114
|
else
|
113
115
|
ActiveRecord::Associations::Preloader.new().preload(result, :translations)
|
@@ -143,7 +145,9 @@ module Tolk
|
|
143
145
|
# phrases = phrases.scoped(:conditions => ['tolk_phrases.id NOT IN (?) AND tolk_phrases.id IN(?)', existing_ids, found_translations_ids]) if existing_ids.present?
|
144
146
|
phrases = phrases.where(['tolk_phrases.id NOT IN (?) AND tolk_phrases.id IN(?)', existing_ids, found_translations_ids]) if existing_ids.present?
|
145
147
|
result = phrases.public_send(pagination_method, page)
|
146
|
-
if Rails.version
|
148
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('7')
|
149
|
+
ActiveRecord::Associations::Preloader.new(records: result, associations: :translations).call
|
150
|
+
elsif Rails.version =~ /^4\.0/
|
147
151
|
ActiveRecord::Associations::Preloader.new result, :translations
|
148
152
|
else
|
149
153
|
ActiveRecord::Associations::Preloader.new().preload(result, :translations)
|
@@ -153,14 +157,14 @@ module Tolk
|
|
153
157
|
end
|
154
158
|
|
155
159
|
def to_hash
|
156
|
-
data = translations.
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
160
|
+
data = translations.includes(:phrase).references(:phrases).order(phrases.arel_table[:key]).
|
161
|
+
each_with_object({}) do |translation, locale|
|
162
|
+
if translation.phrase.key.include?(".")
|
163
|
+
locale.deep_merge!(unsquish(translation.phrase.key, translation.value))
|
164
|
+
else
|
165
|
+
locale[translation.phrase.key] = translation.value
|
166
|
+
end
|
162
167
|
end
|
163
|
-
end
|
164
168
|
{ name => data }
|
165
169
|
end
|
166
170
|
|
@@ -186,7 +190,9 @@ module Tolk
|
|
186
190
|
def translations_with_html
|
187
191
|
translations = self.translations.all(:conditions => "tolk_translations.text LIKE '%>%' AND
|
188
192
|
tolk_translations.text LIKE '%<%' AND tolk_phrases.key NOT LIKE '%_html'", :joins => :phrase)
|
189
|
-
if Rails.version
|
193
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('7')
|
194
|
+
ActiveRecord::Associations::Preloader.new(records: result, associations: :translations).call
|
195
|
+
elsif Rails.version =~ /^4\.0/
|
190
196
|
ActiveRecord::Associations::Preloader.new translations, :phrase
|
191
197
|
else
|
192
198
|
ActiveRecord::Associations::Preloader.new().preload(translations, :phrase)
|
@@ -230,7 +236,9 @@ module Tolk
|
|
230
236
|
phrase.translation = phrase.translations.for(self)
|
231
237
|
end
|
232
238
|
|
233
|
-
if Rails.version
|
239
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('7')
|
240
|
+
ActiveRecord::Associations::Preloader.new(records: result, associations: :translations).call
|
241
|
+
elsif Rails.version =~ /^4\.0/
|
234
242
|
ActiveRecord::Associations::Preloader.new result, :translations
|
235
243
|
else
|
236
244
|
ActiveRecord::Associations::Preloader.new().preload(result, :translations)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/tolk/pagination.rb
CHANGED
data/lib/tolk/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tolk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2022-03-28 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rails
|
@@ -29,47 +29,47 @@ dependencies:
|
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: '5.0'
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
|
-
name:
|
32
|
+
name: sprockets-rails
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- - "
|
35
|
+
- - "~>"
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: '3.4'
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- - "
|
42
|
+
- - "~>"
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
44
|
+
version: '3.4'
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
|
-
name:
|
46
|
+
name: safe_yaml
|
47
47
|
requirement: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
49
|
- - ">="
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version:
|
51
|
+
version: 0.8.6
|
52
52
|
type: :runtime
|
53
53
|
prerelease: false
|
54
54
|
version_requirements: !ruby/object:Gem::Requirement
|
55
55
|
requirements:
|
56
56
|
- - ">="
|
57
57
|
- !ruby/object:Gem::Version
|
58
|
-
version:
|
58
|
+
version: 0.8.6
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
|
-
name:
|
60
|
+
name: sassc
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
62
62
|
requirements:
|
63
|
-
- - "
|
63
|
+
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: '
|
66
|
-
type: :
|
65
|
+
version: '0'
|
66
|
+
type: :runtime
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
- - "
|
70
|
+
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
72
|
+
version: '0'
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: sqlite3
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -105,7 +105,7 @@ dependencies:
|
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: '1.0'
|
107
107
|
- !ruby/object:Gem::Dependency
|
108
|
-
name:
|
108
|
+
name: will_paginate
|
109
109
|
requirement: !ruby/object:Gem::Requirement
|
110
110
|
requirements:
|
111
111
|
- - ">="
|
@@ -119,7 +119,21 @@ dependencies:
|
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '0'
|
121
121
|
- !ruby/object:Gem::Dependency
|
122
|
-
name:
|
122
|
+
name: capybara
|
123
|
+
requirement: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - "~>"
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '3.14'
|
128
|
+
type: :development
|
129
|
+
prerelease: false
|
130
|
+
version_requirements: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - "~>"
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '3.14'
|
135
|
+
- !ruby/object:Gem::Dependency
|
136
|
+
name: cuprite
|
123
137
|
requirement: !ruby/object:Gem::Requirement
|
124
138
|
requirements:
|
125
139
|
- - ">="
|
@@ -132,6 +146,20 @@ dependencies:
|
|
132
146
|
- - ">="
|
133
147
|
- !ruby/object:Gem::Version
|
134
148
|
version: '0'
|
149
|
+
- !ruby/object:Gem::Dependency
|
150
|
+
name: puma
|
151
|
+
requirement: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - "~>"
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '5.5'
|
156
|
+
type: :development
|
157
|
+
prerelease: false
|
158
|
+
version_requirements: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - "~>"
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '5.5'
|
135
163
|
description: Tolk is a web interface for doing i18n translations packaged as an engine
|
136
164
|
for Rails applications.
|
137
165
|
email: david@loudthinking.com
|
@@ -157,11 +185,11 @@ files:
|
|
157
185
|
- app/models/tolk/phrase.rb
|
158
186
|
- app/models/tolk/translation.rb
|
159
187
|
- app/views/layouts/tolk/application.html.erb
|
160
|
-
- app/views/tolk/_blank_canva.
|
161
|
-
- app/views/tolk/_empty.
|
162
|
-
- app/views/tolk/_houra.
|
188
|
+
- app/views/tolk/_blank_canva.html.erb
|
189
|
+
- app/views/tolk/_empty.html.erb
|
190
|
+
- app/views/tolk/_houra.html.erb
|
163
191
|
- app/views/tolk/_nav.html.erb
|
164
|
-
- app/views/tolk/_no_data.
|
192
|
+
- app/views/tolk/_no_data.html.erb
|
165
193
|
- app/views/tolk/locales/all.html.erb
|
166
194
|
- app/views/tolk/locales/index.html.erb
|
167
195
|
- app/views/tolk/locales/show.atom.builder
|
@@ -204,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
232
|
- !ruby/object:Gem::Version
|
205
233
|
version: '0'
|
206
234
|
requirements: []
|
207
|
-
rubygems_version: 3.
|
235
|
+
rubygems_version: 3.3.4
|
208
236
|
signing_key:
|
209
237
|
specification_version: 4
|
210
238
|
summary: Rails engine providing web interface for managing i18n yaml files
|