Skip to content

Commit

Permalink
Add plurals dropped from rails-i18n in 7.0.6
Browse files Browse the repository at this point in the history
The 7.0.6 release of rails-i18n dropped support for a number of plurals
[1] and this causes our apps that make use of these languages to error
and thus be unable to update to rails-i18n 7.0.6

This commit ports over these rules from rails-i18n to maintain the
behaviour.

This update follows what was added into govuk_app_config [2]

[1]: svenfuchs/rails-i18n#1017
[2]: alphagov/govuk_app_config#266
  • Loading branch information
chao-xian committed Nov 16, 2022
1 parent b1b8a3b commit 6a7d153
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions config/locales/plurals.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# frozen_string_literal: true

{
# Welsh
cy: { i18n: { plural: { keys: %i[zero one two few many other],
rule:
lambda do |n|
case n
when 0 then :zero
when 1 then :one
when 2 then :two
when 3 then :few
when 6 then :many
else :other
end
end } } },
# Dari - this isn't an iso code. Probably should be 'prs' as per ISO 639-3.
dr: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
# Latin America and Caribbean Spanish
Expand Down

0 comments on commit 6a7d153

Please sign in to comment.