l10n 2.0.1 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/lib/l10n/core_extensions/numeric_ext.rb +1 -0
- data/lib/l10n/numeric_column_conversions.rb +7 -8
- data/lib/l10n/version.rb +1 -1
- data/lib/l10n.rb +1 -0
- metadata +19 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1be2e544d58d781864749ead7f43db89099ae84cf1bfdb70227b6219a3cead87
|
4
|
+
data.tar.gz: 4e7ac3473aad904ef817caf8ce47ab3f44eee477efbee945d5afe1c90fb48d1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbb29df1f4901852712dd46dc52ba11466b6a0a2f7937f0f230649b5c6f6fe60d4b4d76d4670280335225e60430889a66610d0f60672d5317f57c24f2761a457
|
7
|
+
data.tar.gz: 6daf99f72e40a9a3b0c01aba698e00428be462c7bb1dcb3333799ac9c92869be795ba1e945b016da1a327bb9e23f086d2bd46bd8600ac7b27d3d175d0ce09284
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -115,7 +115,7 @@ This also works with `BigDecimal`s.
|
|
115
115
|
#### Localization of decimal separator and delimiter for numbers
|
116
116
|
|
117
117
|
Localization converts decimal separators and delimiters between locales without
|
118
|
-
re-formatting strings. `
|
118
|
+
re-formatting strings. `to_ls` can be called on any object.
|
119
119
|
|
120
120
|
```ruby
|
121
121
|
I18n.as('de') { 1234.5.to_localized_s } => "1.234,5"
|
@@ -1,18 +1,17 @@
|
|
1
|
-
require '
|
1
|
+
require 'active_model'
|
2
2
|
|
3
3
|
module L10n
|
4
4
|
module NumericColumnConversions
|
5
5
|
|
6
|
-
def
|
7
|
-
|
8
|
-
if column && [:integer, :float, :decimal].include?(column.type) && value.is_a?(String)
|
6
|
+
def from_user(name, value, type, original_attribute = nil)
|
7
|
+
if [:integer, :float, :decimal].include?(type.try(:type)) && value.is_a?(String)
|
9
8
|
value = Numeric.delocalize(value)
|
10
9
|
end
|
11
|
-
super(
|
10
|
+
super(name, value, type, original_attribute)
|
12
11
|
end
|
13
|
-
|
12
|
+
|
14
13
|
end
|
15
|
-
|
14
|
+
|
16
15
|
end
|
17
16
|
|
18
|
-
|
17
|
+
ActiveModel::Attribute.singleton_class.prepend L10n::NumericColumnConversions
|
data/lib/l10n/version.rb
CHANGED
data/lib/l10n.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: l10n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -31,9 +31,9 @@ dependencies:
|
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 7.0.0
|
34
|
-
- - "
|
34
|
+
- - "~>"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '7.
|
36
|
+
version: '7.2'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -41,9 +41,9 @@ dependencies:
|
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: 7.0.0
|
44
|
-
- - "
|
44
|
+
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '7.
|
46
|
+
version: '7.2'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: activesupport
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -51,9 +51,9 @@ dependencies:
|
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: 7.0.0
|
54
|
-
- - "
|
54
|
+
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '7.
|
56
|
+
version: '7.2'
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -61,9 +61,9 @@ dependencies:
|
|
61
61
|
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: 7.0.0
|
64
|
-
- - "
|
64
|
+
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '7.
|
66
|
+
version: '7.2'
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: actionpack
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -71,9 +71,9 @@ dependencies:
|
|
71
71
|
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: 7.0.0
|
74
|
-
- - "
|
74
|
+
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '7.
|
76
|
+
version: '7.2'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -81,9 +81,9 @@ dependencies:
|
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: 7.0.0
|
84
|
-
- - "
|
84
|
+
- - "~>"
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version: '7.
|
86
|
+
version: '7.2'
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: railties
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
@@ -91,9 +91,9 @@ dependencies:
|
|
91
91
|
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: 7.0.0
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '7.
|
96
|
+
version: '7.2'
|
97
97
|
type: :runtime
|
98
98
|
prerelease: false
|
99
99
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -101,9 +101,9 @@ dependencies:
|
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: 7.0.0
|
104
|
-
- - "
|
104
|
+
- - "~>"
|
105
105
|
- !ruby/object:Gem::Version
|
106
|
-
version: '7.
|
106
|
+
version: '7.2'
|
107
107
|
description: Extensions for Rails I18n
|
108
108
|
email: mtgrosser@gmx.net
|
109
109
|
executables: []
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
|
-
rubygems_version: 3.
|
154
|
+
rubygems_version: 3.4.10
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
157
|
summary: Make I18n roar again
|