i18n 1.3.0 → 1.4.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/lib/i18n/core_ext/hash.rb +20 -10
- data/lib/i18n/version.rb +1 -1
- metadata +2 -3
- data/lib/i18n/core_ext/string/interpolate.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8261641c6a20a87755f261c21a4148f5b414577c2fbc127b31ffaf59e93bb88e
|
4
|
+
data.tar.gz: 8710ff18593cdab6cdd2388f3726d3da41d5a1129eade70b3cac8e8d100c804b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a74081f5e0ad3d800857b64541ec97e0d48602bfc81b5d1e54a72ede4e8244599f9d1f3b07a0ed33eb6f2e5730c80f468e1097815fadde9f9c0c1edd63f1b10
|
7
|
+
data.tar.gz: 3ff46b06293eaa68353b15a64645323da870e6afa0f8a2b5f3559983966166a950e74cf2ade96cf3a3d22cb7940d01b448feecb71ad052bf43433ebbe1da2c3c
|
data/lib/i18n/core_ext/hash.rb
CHANGED
@@ -1,20 +1,19 @@
|
|
1
1
|
module I18n
|
2
2
|
module HashRefinements
|
3
3
|
refine Hash do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
h
|
4
|
+
using I18n::HashRefinements
|
5
|
+
def except(*keys)
|
6
|
+
dup.except!(*keys)
|
8
7
|
end
|
9
8
|
|
10
|
-
def except(*
|
11
|
-
|
9
|
+
def except!(*keys)
|
10
|
+
keys.each { |key| delete(key) }
|
11
|
+
self
|
12
12
|
end
|
13
13
|
|
14
14
|
def deep_symbolize_keys
|
15
15
|
each_with_object({}) do |(key, value), result|
|
16
|
-
|
17
|
-
result[symbolize_key(key)] = value
|
16
|
+
result[symbolize_key(key)] = deep_symbolize_keys_in_object(value)
|
18
17
|
result
|
19
18
|
end
|
20
19
|
end
|
@@ -27,11 +26,22 @@ module I18n
|
|
27
26
|
merge!(data, &merger)
|
28
27
|
end
|
29
28
|
|
30
|
-
private
|
31
|
-
|
32
29
|
def symbolize_key(key)
|
33
30
|
key.respond_to?(:to_sym) ? key.to_sym : key
|
34
31
|
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def deep_symbolize_keys_in_object(value)
|
36
|
+
case value
|
37
|
+
when Hash
|
38
|
+
value.deep_symbolize_keys
|
39
|
+
when Array
|
40
|
+
value.map { |e| deep_symbolize_keys_in_object(e) }
|
41
|
+
else
|
42
|
+
value
|
43
|
+
end
|
44
|
+
end
|
35
45
|
end
|
36
46
|
end
|
37
47
|
end
|
data/lib/i18n/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Fuchs
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date:
|
16
|
+
date: 2019-01-01 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: concurrent-ruby
|
@@ -56,7 +56,6 @@ files:
|
|
56
56
|
- lib/i18n/backend/transliterator.rb
|
57
57
|
- lib/i18n/config.rb
|
58
58
|
- lib/i18n/core_ext/hash.rb
|
59
|
-
- lib/i18n/core_ext/string/interpolate.rb
|
60
59
|
- lib/i18n/exceptions.rb
|
61
60
|
- lib/i18n/gettext.rb
|
62
61
|
- lib/i18n/gettext/helpers.rb
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# This file used to backport the Ruby 1.9 String interpolation syntax to Ruby 1.8.
|
2
|
-
#
|
3
|
-
# Since I18n has dropped support to Ruby 1.8, this file is not required anymore,
|
4
|
-
# however, Rails 3.2 still requires it directly:
|
5
|
-
#
|
6
|
-
# https://github.com/rails/rails/blob/3-2-stable/activesupport/lib/active_support/core_ext/string/interpolation.rb#L2
|
7
|
-
#
|
8
|
-
# So we can't just drop the file entirely, which would then break Rails users
|
9
|
-
# under Ruby 1.9. This file can be removed once Rails 3.2 support is dropped.
|