embedded_localization 1.2.2 → 1.3.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/.travis.yml +2 -0
- data/CHANGELOG.md +50 -0
- data/Gemfile +2 -2
- data/README.md +143 -171
- data/embedded_localization.gemspec +24 -19
- data/lib/embedded_localization/active_record/act_macro.rb +1 -1
- data/lib/embedded_localization/version.rb +1 -1
- data/spec/spec_helper.rb +0 -4
- metadata +13 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c558dc3ee3d3357b8bf674ee00423dda8dd10c855deb800b1b4e47946fa1318f
|
4
|
+
data.tar.gz: 252b5481dbc39a41e800551411a1426db9f4fea1759c2c6a7b05e9e6285a1a24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8a28976e403460d65d6fd9c5af50b224ffa46a9d7b466c7bfec4e4766aa762c2c65e5bb54fdb2b0dd7b7c2a4f6d91759889b067e370af9161a869e7ad7b1804
|
7
|
+
data.tar.gz: f7353af27a41afcc4db023bcff8b229f90e062bb8388c84bf4991de528f3021c5e1d00116ea91d8728ff1ffc59f22c648326379d1501e5749f2c3c999992a3df
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# EmbeddedLocalization CHANGE LOG
|
2
|
+
|
3
|
+
## 1.3.0 (2024-11-13)
|
4
|
+
- fixed ([issue 10](https://github.com/tilo/embedded_localization/issues)) to support Rails >= 7.1 (thanks to [Romain Morlevat](https://github.com/RomainMorlevat))
|
5
|
+
|
6
|
+
## 1.2.2 (2022-04-25)
|
7
|
+
* improved docs
|
8
|
+
|
9
|
+
## 1.2.0 (2017-11-10)
|
10
|
+
* Rails 5 compatibility
|
11
|
+
* fixing tests
|
12
|
+
* updating doc
|
13
|
+
|
14
|
+
## 1.1.1 (2014-11-02)
|
15
|
+
* minor update
|
16
|
+
|
17
|
+
## 1.1.0 (2014-01-12)
|
18
|
+
* adding more rspec tests.
|
19
|
+
* improving documentation and README
|
20
|
+
|
21
|
+
## 1.0.0 (2014-01-11)
|
22
|
+
* adding rspec tests.
|
23
|
+
* fixing issue #6: translated fields for new records were not nil
|
24
|
+
* fixing issue #7: translation_missing for new records is breaking
|
25
|
+
|
26
|
+
|
27
|
+
## 0.2.5 (2013-11-02)
|
28
|
+
* adding MIT and GPL-2 licenses to gem-spec file; contact me if you need another license
|
29
|
+
|
30
|
+
## 0.2.4 (2012-03-02)
|
31
|
+
* Issue #5 : bugfix for attr_writer
|
32
|
+
|
33
|
+
## 0.2.3 (2012-03-02)
|
34
|
+
* Issue #4 : bugfix for attr_writer - no longer updates attributes if value didn't change => timestamps don't change in that case
|
35
|
+
|
36
|
+
## 0.2.2 (2012-02-06)
|
37
|
+
* bugfix for attr_writer
|
38
|
+
|
39
|
+
## 0.2.1 (2012-01-31)
|
40
|
+
* bugfix for serialized i18n attribute
|
41
|
+
|
42
|
+
## 0.2.0 (2012-01-31)
|
43
|
+
* added support for having DB columns for translated attributes, to enable SQL queries in `I18n.default_locale`
|
44
|
+
|
45
|
+
## 0.1.4 (2012-01-31)
|
46
|
+
* fixed bug with dirty tracking of serialized i18n attribute
|
47
|
+
* renamed #fallback? to #fallbacks?
|
48
|
+
|
49
|
+
## 0.1.3 Initial Version (2012-01-27)
|
50
|
+
* initial version
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[](http://travis-ci.org/tilo/embedded_localization) [](http://badge.fury.io/rb/embedded_localization)
|
4
4
|
|
5
|
-
`embedded_localization` is compatible with Rails
|
5
|
+
`embedded_localization` is compatible with Rails 6.x, 7.x, and adds model translations to ActiveRecord. `embedded_localization` is compatible with and builds on the new [I18n API in Ruby on Rails](http://guides.rubyonrails.org/i18n.html)
|
6
6
|
|
7
7
|
`embedded_localization` is very lightweight, and allows you to transparently store translations of attributes right inside each record — no extra database tables needed to store the localization data! Make sure that your database default encoding is UTF-8 or UFT-16.
|
8
8
|
|
@@ -24,7 +24,7 @@ If your requirements are different, this approach might not work for you. In tha
|
|
24
24
|
|
25
25
|
## Requirements
|
26
26
|
|
27
|
-
* ActiveRecord >=
|
27
|
+
* ActiveRecord >= 6
|
28
28
|
* [I18n](http://guides.rubyonrails.org/i18n.html)
|
29
29
|
|
30
30
|
## Installation
|
@@ -46,21 +46,25 @@ Model translations allow you to translate your models’ attribute values. The a
|
|
46
46
|
|
47
47
|
Let's assume you have a table for movie genres, and you want to translate the names and the descriptions of the genres. Simply define your `Genre` model as follows:
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
```ruby
|
50
|
+
class Genre < ActiveRecord::Base
|
51
|
+
translates :name, :description
|
52
|
+
end
|
53
|
+
```
|
52
54
|
|
53
55
|
In the DB migration, you just need to add the `i18n` text field:
|
54
56
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
57
|
+
```ruby
|
58
|
+
class CreateGenres < ActiveRecord::Migration
|
59
|
+
def self.change
|
60
|
+
create_table :genres do |t|
|
61
|
+
t.text :i18n # stores ALL the translated attributes; persisted as a Hash
|
59
62
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
63
|
+
t.timestamps
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
```
|
64
68
|
|
65
69
|
### Example 2
|
66
70
|
|
@@ -71,17 +75,19 @@ This way you can always do SQL queries against the values in the `I18n.default_l
|
|
71
75
|
|
72
76
|
To do this, using the same model as in example 1, you can modify your migration as follows:
|
73
77
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
+
```ruby
|
79
|
+
class CreateGenres < ActiveRecord::Migration
|
80
|
+
def self.change
|
81
|
+
create_table :genres do |t|
|
82
|
+
t.text :i18n # stores the translated attributes; persisted as a Hash
|
78
83
|
|
79
|
-
|
84
|
+
t.string :name # allows us to do SQL queries
|
80
85
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
86
|
+
t.timestamps
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
```
|
85
91
|
|
86
92
|
# Usage
|
87
93
|
|
@@ -92,44 +98,47 @@ In your code you can modify the values of your translated attributes in two ways
|
|
92
98
|
Using the built-in getter/setter methods you can set the values for any locale directly, even though
|
93
99
|
you are using your own locale.
|
94
100
|
|
95
|
-
|
96
|
-
|
97
|
-
|
101
|
+
```ruby
|
102
|
+
I18n.locale = :en
|
103
|
+
g = Genre.first
|
104
|
+
g.name = 'science fiction'
|
98
105
|
|
99
|
-
|
106
|
+
# even though you are using the :en locale, you can still set the values for other locales:
|
100
107
|
|
101
|
-
|
102
|
-
|
108
|
+
g.set_localized_attribute( :name, :jp, "サイエンスフィクション" )
|
109
|
+
g.set_localized_attribute( :name, :ko, "공상 과학 소설" )
|
103
110
|
|
104
|
-
|
105
|
-
|
106
|
-
|
111
|
+
g.name # => 'science fiction'
|
112
|
+
g.name(:jp) # => "サイエンスフィクション"
|
113
|
+
g.name(:ko) # => "공상 과학 소설"
|
107
114
|
|
108
|
-
|
109
|
-
|
115
|
+
g.get_localized_attribute( :name, :jp ) # => "サイエンスフィクション"
|
116
|
+
g.get_localized_attribute( :name, :ko ) # => "공상 과학 소설"
|
117
|
+
```
|
110
118
|
|
111
119
|
## Tweaking `I18n.locale`
|
112
120
|
|
113
121
|
By manipulating the `I18n.locale`. This is what happens if you have user's with different locales entering values into a database.
|
114
122
|
|
115
|
-
|
123
|
+
The controller is just assigning the new value via `name=` , but `embedded_localization` gem takes care of storing it for the correct given locale.
|
116
124
|
|
117
|
-
|
118
|
-
|
119
|
-
|
125
|
+
```ruby
|
126
|
+
I18n.locale = :en
|
127
|
+
g = Genre.first
|
128
|
+
g.name # => 'science fiction'
|
120
129
|
|
121
|
-
|
122
|
-
|
130
|
+
I18n.locale = :jp
|
131
|
+
g.name = "サイエンスフィクション"
|
123
132
|
|
124
|
-
|
125
|
-
|
126
|
-
|
133
|
+
I18n.locale = :ko
|
134
|
+
g.name = "공상 과학 소설"
|
135
|
+
g.name # => "공상 과학 소설"
|
127
136
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
I18n.locale = :en # MAKE SURE to switch back to your default locale if you tweak it
|
137
|
+
I18n.locale = :jp
|
138
|
+
g.name # => "サイエンスフィクション"
|
132
139
|
|
140
|
+
I18n.locale = :en # MAKE SURE to switch back to your default locale if you tweak it
|
141
|
+
```
|
133
142
|
|
134
143
|
## SQL Queries against Translated Fields
|
135
144
|
|
@@ -143,13 +152,15 @@ After defining the column, and running the migration, you need to populate the c
|
|
143
152
|
|
144
153
|
See also Example 2 above.
|
145
154
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
155
|
+
```ruby
|
156
|
+
I18n.locale = :en
|
157
|
+
g = Genre.first
|
158
|
+
g.name = 'science fiction' # in Example 2 this will be stored in the DB column :name as well
|
159
|
+
# ...
|
160
|
+
g.set_localized_attribute( :name, :jp, "サイエンスフィクション" )
|
161
|
+
# ...
|
162
|
+
scifi = Genre.where(:name => "science fiction").first
|
163
|
+
```
|
153
164
|
|
154
165
|
Limitation: You can not search for the translated strings other than for your default locale.
|
155
166
|
|
@@ -159,12 +170,14 @@ Limitation: You can not search for the translated strings other than for your de
|
|
159
170
|
|
160
171
|
Existing data can be migrated from an existing (not-translated) column, into a translated column with the same name as follows:
|
161
172
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
173
|
+
```ruby
|
174
|
+
Genre.record_timestamps = false # to not modify your existing timestamps
|
175
|
+
Genre.all.each do |g|
|
176
|
+
g.name = g.name # the right-hand-side fetches the translation from the i18n attribute hash
|
177
|
+
g.save # saves the :name attribute without updating the updated_at timestamp
|
178
|
+
end
|
179
|
+
Genre.record_timestamps = true
|
180
|
+
```
|
168
181
|
|
169
182
|
## I18n fallbacks for empty translations
|
170
183
|
|
@@ -172,30 +185,31 @@ It is possible to enable fallbacks for empty translations. It will depend on the
|
|
172
185
|
|
173
186
|
You can enable them by adding the next line to `config/application.rb` (or only `config/environments/production.rb` if you only want them in production)
|
174
187
|
|
175
|
-
|
176
|
-
|
177
|
-
|
188
|
+
```ruby
|
189
|
+
config.i18n.fallbacks = true # falls back to I18n.default_locale
|
190
|
+
```
|
178
191
|
|
179
192
|
By default, `embedded_localization` will only use fallbacks when the translation value for the item you've requested is `nil`.
|
180
193
|
|
194
|
+
```ruby
|
195
|
+
class Genre < ActiveRecord::Base
|
196
|
+
translates :name, :description # , :fallbacks => true
|
197
|
+
end
|
181
198
|
|
182
|
-
|
183
|
-
|
184
|
-
|
199
|
+
I18n.locale = :en
|
200
|
+
g = Genre.first
|
201
|
+
g.name # => 'science fiction'
|
185
202
|
|
186
|
-
|
187
|
-
|
188
|
-
g.name # => 'science fiction'
|
203
|
+
I18n.locale = :jp
|
204
|
+
g.name # => "サイエンスフィクション"
|
189
205
|
|
190
|
-
|
191
|
-
|
206
|
+
I18n.locale = :de
|
207
|
+
g.name # => nil
|
192
208
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
I18n.locale = :de
|
198
|
-
g.name # => 'science fiction'
|
209
|
+
I18n.fallbacks = true
|
210
|
+
I18n.locale = :de
|
211
|
+
g.name # => 'science fiction'
|
212
|
+
```
|
199
213
|
|
200
214
|
## Want some Candy?
|
201
215
|
|
@@ -211,10 +225,11 @@ Each class which uses `embedded_localization` will have these additional methods
|
|
211
225
|
|
212
226
|
e.g.:
|
213
227
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
228
|
+
```ruby
|
229
|
+
Genre.translated_attributes # => [:name,:description]
|
230
|
+
Genre.translated? # => true
|
231
|
+
Genre.fallbacks? # => false
|
232
|
+
```
|
218
233
|
|
219
234
|
### Instance Methods
|
220
235
|
|
@@ -229,40 +244,39 @@ Each model instance of a class which uses `embedded_localization` will have thes
|
|
229
244
|
|
230
245
|
e.g.:
|
231
246
|
|
232
|
-
|
233
|
-
|
234
|
-
# check if an attribute is translated:
|
235
|
-
g.translated?(:name) # => true
|
247
|
+
```ruby
|
248
|
+
g = Genre.where(:name => "science fiction").first
|
236
249
|
|
237
|
-
|
238
|
-
|
250
|
+
# check if an attribute is translated:
|
251
|
+
g.translated?(:name) # => true
|
239
252
|
|
240
|
-
|
241
|
-
|
253
|
+
# which attributes are translated?
|
254
|
+
g.translated_attributes # => [:description, :name]
|
242
255
|
|
243
|
-
|
256
|
+
# check for which locales we have values: (spanning all translated fields)
|
257
|
+
g.translated_locales # => [:en]
|
244
258
|
|
245
|
-
|
246
|
-
g.translated_locales # => [:en, :de]
|
259
|
+
g.set_localized_attribute(:description, :de, "Ich liebe Science Fiction Filme")
|
247
260
|
|
248
|
-
|
249
|
-
|
250
|
-
g.translation_coverage # => {:name=>[:en], :description=>[:de]}
|
261
|
+
# check again for which locales we have values: (spanning all translated fields)
|
262
|
+
g.translated_locales # => [:en, :de]
|
251
263
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
# show where translations are missing:
|
257
|
-
# for all attributes:
|
258
|
-
g.translation_missing # => {:description=>[:en], :name=>[:de]}
|
259
|
-
|
260
|
-
# for a specific attribute:
|
261
|
-
g.translation_missing(:name) # => [:de]
|
262
|
-
g.translation_missing(:description) # => [:en]
|
264
|
+
# show details for which locales the attributes have values for:
|
265
|
+
# for all attributes:
|
266
|
+
g.translation_coverage # => {:name=>[:en], :description=>[:de]}
|
263
267
|
|
268
|
+
# for a specific attribute:
|
269
|
+
g.translation_coverage(:name) # => [:en]
|
270
|
+
g.translation_coverage(:description) # => [:de]
|
264
271
|
|
272
|
+
# show where translations are missing:
|
273
|
+
# for all attributes:
|
274
|
+
g.translation_missing # => {:description=>[:en], :name=>[:de]}
|
265
275
|
|
276
|
+
# for a specific attribute:
|
277
|
+
g.translation_missing(:name) # => [:de]
|
278
|
+
g.translation_missing(:description) # => [:en]
|
279
|
+
```
|
266
280
|
|
267
281
|
#### translated_locales vs translation_coverage
|
268
282
|
|
@@ -282,81 +296,39 @@ For a new empty record, this will be empty.
|
|
282
296
|
|
283
297
|
##### Example
|
284
298
|
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
g.name(:en) # => 'science fiction'
|
290
|
-
g.name(:ko) # => "공상 과학 소설"
|
291
|
-
g.name(:de) # => nil
|
292
|
-
|
293
|
-
g.translated_locales # => [:en,:jp,:ko]
|
294
|
-
g.translated_attributes # => [:name,:description]
|
295
|
-
g.translated? # => true
|
296
|
-
|
297
|
-
g.translation_coverage
|
298
|
-
# => {"name"=>["en", "ko", "jp"] , "description"=>["en", "de", "fr", "ko", "jp", "es"]}
|
299
|
-
|
300
|
-
g.translation_coverage(:name)
|
301
|
-
# => {"name"=>["en", "ko", "jp"]}
|
302
|
-
|
303
|
-
g.translation_missing
|
304
|
-
# => {"name"=>["de", "fr", "es"]}
|
305
|
-
|
306
|
-
g.translation_missing(:display)
|
307
|
-
# => {} # this indicates that there are no missing translations for the :display attribute
|
308
|
-
|
309
|
-
g.get_localized_attribute(:name, :de)
|
310
|
-
# => nil
|
311
|
-
|
312
|
-
g.set_localized_attribute(:name, :de, "Science-Fiction")
|
313
|
-
# => "Science-Fiction"
|
314
|
-
|
315
|
-
## Changes
|
316
|
-
|
317
|
-
### 1.2.0 (2017-11-10)
|
318
|
-
* Rails 5 compatibility
|
319
|
-
* fixing tests
|
320
|
-
* updating doc
|
321
|
-
|
322
|
-
### 1.1.1 (2014-11-02)
|
323
|
-
* minor update
|
324
|
-
|
325
|
-
### 1.1.0 (2014-01-12)
|
326
|
-
* adding more rspec tests.
|
327
|
-
* improving documentation and README
|
328
|
-
|
329
|
-
### 1.0.0 (2014-01-11)
|
330
|
-
* adding rspec tests.
|
331
|
-
* fixing issue #6: translated fields for new records were not nil
|
332
|
-
* fixing issue #7: translation_missing for new records is breaking
|
333
|
-
|
299
|
+
```ruby
|
300
|
+
I18n.locale = :jp
|
301
|
+
g = Genre.first
|
302
|
+
g.name # => "サイエンスフィクション"
|
334
303
|
|
335
|
-
|
336
|
-
|
304
|
+
g.name(:en) # => 'science fiction'
|
305
|
+
g.name(:ko) # => "공상 과학 소설"
|
306
|
+
g.name(:de) # => nil
|
337
307
|
|
338
|
-
|
339
|
-
|
308
|
+
g.translated_locales # => [:en,:jp,:ko]
|
309
|
+
g.translated_attributes # => [:name,:description]
|
310
|
+
g.translated? # => true
|
340
311
|
|
341
|
-
|
342
|
-
|
312
|
+
g.translation_coverage
|
313
|
+
# => {"name"=>["en", "ko", "jp"] , "description"=>["en", "de", "fr", "ko", "jp", "es"]}
|
343
314
|
|
344
|
-
|
345
|
-
|
315
|
+
g.translation_coverage(:name)
|
316
|
+
# => {"name"=>["en", "ko", "jp"]}
|
346
317
|
|
347
|
-
|
348
|
-
|
318
|
+
g.translation_missing
|
319
|
+
# => {"name"=>["de", "fr", "es"]}
|
349
320
|
|
350
|
-
|
351
|
-
|
321
|
+
g.translation_missing(:display)
|
322
|
+
# => {} # this indicates that there are no missing translations for the :display attribute
|
352
323
|
|
353
|
-
|
354
|
-
|
355
|
-
* renamed #fallback? to #fallbacks?
|
324
|
+
g.get_localized_attribute(:name, :de)
|
325
|
+
# => nil
|
356
326
|
|
357
|
-
|
358
|
-
|
327
|
+
g.set_localized_attribute(:name, :de, "Science-Fiction")
|
328
|
+
# => "Science-Fiction"
|
329
|
+
```
|
359
330
|
|
331
|
+
## [CHANGELOG](CHANGELOG.md)
|
360
332
|
|
361
333
|
## Alternative Solutions
|
362
334
|
|
@@ -2,26 +2,31 @@
|
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
3
|
require "embedded_localization/version"
|
4
4
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "embedded_localization"
|
7
|
+
spec.version = EmbeddedLocalization::VERSION
|
8
|
+
spec.authors = ["Tilo Sloboda"]
|
9
|
+
spec.email = ["tilo.sloboda@gmail.com"]
|
10
|
+
spec.homepage = "https://github.com/tilo/embedded_localization"
|
11
|
+
spec.summary = %q{Rails I18n: library for embedded ActiveRecord model/data translation}
|
12
|
+
spec.description = %q{Rails I18n: Embedded_Localization for ActiveRecord is very lightweight, and allows you to transparently store translations of attributes right inside each record -- no extra database tables needed to store the localization data!}
|
13
13
|
|
14
|
-
#
|
14
|
+
# spec.platform = Gem::Platform::RUBY
|
15
|
+
spec.required_ruby_version = ">= 2.5.0"
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/tilo/embedded_localization/blob/main/CHANGELOG.md"
|
20
|
+
|
21
|
+
spec.files = `git ls-files`.split("\n")
|
22
|
+
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
23
|
+
spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
24
|
+
spec.require_paths = ["lib"]
|
25
|
+
spec.licenses = ['MIT']
|
21
26
|
# specify any dependencies here; for example:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
#
|
27
|
+
spec.add_development_dependency "rspec"
|
28
|
+
spec.add_development_dependency "activerecord", ">= 6"
|
29
|
+
spec.add_development_dependency "i18n"
|
30
|
+
spec.add_development_dependency "sqlite3"
|
31
|
+
# spec.add_runtime_dependency "rest-client"
|
27
32
|
end
|
@@ -23,7 +23,7 @@ module EmbeddedLocalization
|
|
23
23
|
# ::Rails::Railtie.subclasses.map(&:to_s).include?("ActiveRecord::Railtie")
|
24
24
|
#+
|
25
25
|
|
26
|
-
serialize :i18n # we should also protect it from direct assignment by the user
|
26
|
+
serialize :i18n, coder: YAML, type: Hash # we should also protect it from direct assignment by the user
|
27
27
|
|
28
28
|
#-
|
29
29
|
# if Mongoid::Document is in the list of classes which extends the class we are included into:
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embedded_localization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tilo Sloboda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '6'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '6'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: i18n
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -77,6 +77,7 @@ extra_rdoc_files: []
|
|
77
77
|
files:
|
78
78
|
- ".gitignore"
|
79
79
|
- ".travis.yml"
|
80
|
+
- CHANGELOG.md
|
80
81
|
- Gemfile
|
81
82
|
- README.md
|
82
83
|
- Rakefile
|
@@ -97,8 +98,10 @@ files:
|
|
97
98
|
homepage: https://github.com/tilo/embedded_localization
|
98
99
|
licenses:
|
99
100
|
- MIT
|
100
|
-
|
101
|
-
|
101
|
+
metadata:
|
102
|
+
homepage_uri: https://github.com/tilo/embedded_localization
|
103
|
+
source_code_uri: https://github.com/tilo/embedded_localization
|
104
|
+
changelog_uri: https://github.com/tilo/embedded_localization/blob/main/CHANGELOG.md
|
102
105
|
post_install_message:
|
103
106
|
rdoc_options: []
|
104
107
|
require_paths:
|
@@ -107,14 +110,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
110
|
requirements:
|
108
111
|
- - ">="
|
109
112
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
113
|
+
version: 2.5.0
|
111
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
115
|
requirements:
|
113
116
|
- - ">="
|
114
117
|
- !ruby/object:Gem::Version
|
115
118
|
version: '0'
|
116
119
|
requirements: []
|
117
|
-
rubygems_version: 3.
|
120
|
+
rubygems_version: 3.2.3
|
118
121
|
signing_key:
|
119
122
|
specification_version: 4
|
120
123
|
summary: 'Rails I18n: library for embedded ActiveRecord model/data translation'
|