diff options
author | Christian Blais <christ.blais@gmail.com> | 2018-03-04 21:29:54 -0500 |
---|---|---|
committer | Christian Blais <christ.blais@gmail.com> | 2018-03-05 08:41:49 -0500 |
commit | f58e2dd095e2e9e4e42e6d7af229f87e70fd5427 (patch) | |
tree | 61c87e7320bbacf98d3dc61b62dcf64e5d4faa0a /activesupport/CHANGELOG.md | |
parent | ae2d36cf21281f4b720332a086b021d867e80084 (diff) | |
download | rails-f58e2dd095e2e9e4e42e6d7af229f87e70fd5427.tar.gz rails-f58e2dd095e2e9e4e42e6d7af229f87e70fd5427.tar.bz2 rails-f58e2dd095e2e9e4e42e6d7af229f87e70fd5427.zip |
`ActiveSupport::Inflector#ordinal` and `ActiveSupport::Inflector#ordinalize`
now support translations through I18n.
{
fr: {
number: {
nth: {
ordinals: lambda do |_key, number:, **_options|
if number.to_i.abs == 1
'er'
else
'e'
end
end,
ordinalized: lambda do |_key, number:, **_options|
"#{number}#{ActiveSupport::Inflector.ordinal(number)}"
end
}
}
}
}
Diffstat (limited to 'activesupport/CHANGELOG.md')
-rw-r--r-- | activesupport/CHANGELOG.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index a7af51f83e..cbbb8597c2 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,5 +1,33 @@ ## Rails 6.0.0.alpha (Unreleased) ## +* `ActiveSupport::Inflector#ordinal` and `ActiveSupport::Inflector#ordinalize` now support + translations through I18n. + + # locale/fr.rb + + { + fr: { + number: { + nth: { + ordinals: lambda do |_key, number:, **_options| + if number.to_i.abs == 1 + 'er' + else + 'e' + end + end, + + ordinalized: lambda do |_key, number:, **_options| + "#{number}#{ActiveSupport::Inflector.ordinal(number)}" + end + } + } + } + } + + + *Christian Blais* + * Add `:private` option to ActiveSupport's `Module#delegate` in order to delegate methods as private: |