From 6942d68fb240addb96c40efde47f1e48b134b414 Mon Sep 17 00:00:00 2001 From: Murilo Dal Ri Date: Thu, 11 Mar 2021 09:28:29 +0000 Subject: [PATCH 1/2] Removes duplicate plural rules These are now in the i18n gem so we don't need to keep our own: https://github.com/ruby-i18n/i18n/blob/master/test/test_data/locales/plurals.rb --- config/locales/plurals.rb | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/config/locales/plurals.rb b/config/locales/plurals.rb index 2774621fc..53342d82d 100644 --- a/config/locales/plurals.rb +++ b/config/locales/plurals.rb @@ -3,20 +3,8 @@ dr: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, # Armenian hy: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, - # Pushto - ps: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, - # Portugese - pt: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, # Sinhalese si: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, - # Somali - so: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, - # Albanian - sq: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, - # Tamil - ta: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, - # Turkmen - tk: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, # Uzbek uz: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, # Chinese Hong Kong From 0b826a6e6749820467b5aefeb52f7fb7d1d88b3a Mon Sep 17 00:00:00 2001 From: Murilo Dal Ri Date: Thu, 11 Mar 2021 10:55:50 +0000 Subject: [PATCH 2/2] Add plural rules missing from i18n --- config/locales/plurals.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/config/locales/plurals.rb b/config/locales/plurals.rb index 53342d82d..2f0389f13 100644 --- a/config/locales/plurals.rb +++ b/config/locales/plurals.rb @@ -1,8 +1,28 @@ { # 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 + "es-419": { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, + # Scottish Gaelic + gd: { i18n: { plural: { keys: %i[one two few other], + rule: + lambda do |n| + if [1, 11].include?(n) + :one + elsif [2, 12].include?(n) + :two + elsif [3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19].include?(n) + :few + else + :other + end + end } } }, # Armenian hy: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, + # Kazakh + kk: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, + # Punjabi Shahmukhi + "pa-pk": { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, # Sinhalese si: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } }, # Uzbek