l10n 2.0.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -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 +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7a06cb298ed3fcf7c6382968e1a73dcbc7e3ad34d5f35f365552792fef6a394
|
4
|
+
data.tar.gz: 8b1880dda37ecb77c241d7b04c5f5b89e98c6963df59ef9795aae0612e81ba1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e9b9fcab3bd5b84bf75d108cd01771ed3f6d712b9770d24864eaff8e8c8cf8bb7deb9231192a4694e3ac7c65f046beeaee4bbc108d0daa9b8e55b6ed2a36cf6
|
7
|
+
data.tar.gz: 76075e8bda8bc614c5d03c18e48524874bdc27614251a62941809375bdd13a58280e023b2310b8b27394ee0543f1c89ff7302209fb3ed0244ee082f3af2e8ffd
|
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.0
|
4
|
+
version: 2.2.0
|
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: 2023-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -33,7 +33,7 @@ dependencies:
|
|
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
|
@@ -43,7 +43,7 @@ dependencies:
|
|
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
|
@@ -53,7 +53,7 @@ dependencies:
|
|
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
|
@@ -63,7 +63,7 @@ dependencies:
|
|
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
|
@@ -73,7 +73,7 @@ dependencies:
|
|
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
|
@@ -83,7 +83,7 @@ dependencies:
|
|
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
|
@@ -93,7 +93,7 @@ dependencies:
|
|
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
|
@@ -103,7 +103,7 @@ dependencies:
|
|
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
|