french_rails 0.4.2 → 0.4.3
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/french_rails/action_view/text_helper.rb +2 -2
- data/lib/french_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b53947c4e630a049535f4421565a7cb161221781d7487295eca4d421328a9ad
|
|
4
|
+
data.tar.gz: bf61a17767f1d5bbc71970071f1bab45076562d13dd655e310d69b6354417a11
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3100903f03b53fd63c2e453091ec2826216b69003501e4f1aee1f8686de19ed36192748ce1f539c8e8e7ea9bab051fbd8ef9870a22fdba2f84596325b627a46b
|
|
7
|
+
data.tar.gz: 40f1348a5ad3bcc26794b1a7642c461b9034d2b347ab6ef760d5251a528b64e1965b52c5a365b572bc42d94243cd8083d77ede560dcdea844fa687383a0678d1
|
|
@@ -5,7 +5,7 @@ module ActionView
|
|
|
5
5
|
module TextHelper
|
|
6
6
|
|
|
7
7
|
# Monkey-patch the pluralize from ActionView::Helpers::TextHelper
|
|
8
|
-
# to the
|
|
8
|
+
# to the French grammar rules (i.e. absolute value < 2 is singular).
|
|
9
9
|
#
|
|
10
10
|
# Example:
|
|
11
11
|
# pluralize(0, 'euro') => 0 euro
|
|
@@ -17,7 +17,7 @@ module ActionView
|
|
|
17
17
|
# pluralize(-2, 'euro') => 2 euros
|
|
18
18
|
#
|
|
19
19
|
def pluralize(count, singular, plural = nil)
|
|
20
|
-
"#{count || 0}
|
|
20
|
+
"#{number_with_delimiter(count, delimiter: " ", separator: ",") || 0} " + ((count.abs < 2) ? singular : (plural || singular.pluralize))
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
end
|
data/lib/french_rails/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: french_rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bruno Michel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-02-
|
|
11
|
+
date: 2020-02-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|