Skip to content

A platform for community discussion. Free, open, simple.

DEV: Update Ruby I18n pluralization rules

Loïc Guitaut9c57be6403cf
diff --git a/config/locales/plurals.rb b/config/locales/plurals.rb
index ddec81f0432..2dcd6aff486 100644
--- a/config/locales/plurals.rb
+++ b/config/locales/plurals.rb
@@ -1,122 +1,2573 @@
-# encoding: utf-8
# frozen_string_literal: true
-# source: https://github.com/svenfuchs/i18n/blob/master/test/test_data/locales/plurals.rb
+# generated by https://github.com/ruby-i18n/ruby-cldr
# stree-ignore
{
- af: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- am: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
- ar: { i18n: { plural: { keys: [:zero, :one, :two, :few, :many, :other], rule: lambda { |n| n == 0 ? :zero : n == 1 ? :one : n == 2 ? :two : [3, 4, 5, 6, 7, 8, 9, 10].include?(n % 100) ? :few : [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99].include?(n % 100) ? :many : :other } } } },
- az: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- be: { i18n: { plural: { keys: [:one, :few, :many, :other], rule: lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
- bg: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- bh: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
- bn: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- bo: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- bs_BA: { i18n: { plural: { keys: [:one, :few, :other], rule: lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : :other } } } },
- ca: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- cs: { i18n: { plural: { keys: [:one, :few, :other], rule: lambda { |n| n == 1 ? :one : [2, 3, 4].include?(n) ? :few : :other } } } },
- cy: { i18n: { plural: { keys: [:one, :two, :many, :other], rule: lambda { |n| n == 1 ? :one : n == 2 ? :two : n == 8 || n == 11 ? :many : :other } } } },
- da: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- de: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- dz: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- el: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- en: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- eo: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- es: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- et: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- eu: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- fa_IR: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- fi: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- fil: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
- fo: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- fr: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n.between?(0, 2) && n != 2 ? :one : :other } } } },
- fur: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- fy: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- ga: { i18n: { plural: { keys: [:one, :two, :other], rule: lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
- gl: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- gu: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- guw: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
- ha: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- he: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- hi: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
- hr: { i18n: { plural: { keys: [:one, :few, :other], rule: lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : :other } } } },
- # The next line has a fix for ruby-i18n. Hungarian has plural forms. See https://meta.discourse.org/t/issue-with-pluralized-count-translation-override/316019/8
- hu: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- hy: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- id: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- is: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- it: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- iw: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- ja: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- jv: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- ka: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- km: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- kn: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- ko: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- ku: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- lb: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- ln: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
- lt: { i18n: { plural: { keys: [:one, :few, :other], rule: lambda { |n| n % 10 == 1 && ![11, 12, 13, 14, 15, 16, 17, 18, 19].include?(n % 100) ? :one : [2, 3, 4, 5, 6, 7, 8, 9].include?(n % 10) && ![11, 12, 13, 14, 15, 16, 17, 18, 19].include?(n % 100) ? :few : :other } } } },
- lv: { i18n: { plural: { keys: [:zero, :one, :other], rule: lambda { |n| n == 0 ? :zero : n % 10 == 1 && n % 100 != 11 ? :one : :other } } } },
- mg: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
- mk: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n % 10 == 1 ? :one : :other } } } },
- ml: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- mn: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- mo: { i18n: { plural: { keys: [:one, :few, :other], rule: lambda { |n| n == 1 ? :one : n == 0 ? :few : :other } } } },
- mr: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- ms: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- mt: { i18n: { plural: { keys: [:one, :few, :many, :other], rule: lambda { |n| n == 1 ? :one : n == 0 || [2, 3, 4, 5, 6, 7, 8, 9, 10].include?(n % 100) ? :few : [11, 12, 13, 14, 15, 16, 17, 18, 19].include?(n % 100) ? :many : :other } } } },
- my: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- nah: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- nb_NO: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- ne: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- nl: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- nn: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- no: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- nso: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
- om: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- or: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- pa: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- pap: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- pl_PL: { i18n: { plural: { keys: [:one, :few, :other], rule: lambda { |n| n == 1 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : :other } } } },
- ps: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- pt: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
- pt_BR: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- ro: { i18n: { plural: { keys: [:one, :few, :other], rule: lambda { |n| n == 1 ? :one : n == 0 || ((n % 100) >= 1 && (n % 100) <= 19) ? :few : :other } } } },
- ru: { i18n: { plural: { keys: [:one, :few, :many, :other], rule: lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
- se: { i18n: { plural: { keys: [:one, :two, :other], rule: lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
- sh: { i18n: { plural: { keys: [:one, :few, :many, :other], rule: lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
- sk: { i18n: { plural: { keys: [:one, :few, :other], rule: lambda { |n| n == 1 ? :one : [2, 3, 4].include?(n) ? :few : :other } } } },
- sl: { i18n: { plural: { keys: [:one, :two, :few, :other], rule: lambda { |n| n % 100 == 1 ? :one : n % 100 == 2 ? :two : [3, 4].include?(n % 100) ? :few : :other } } } },
- sma: { i18n: { plural: { keys: [:one, :two, :other], rule: lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
- smi: { i18n: { plural: { keys: [:one, :two, :other], rule: lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
- smj: { i18n: { plural: { keys: [:one, :two, :other], rule: lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
- smn: { i18n: { plural: { keys: [:one, :two, :other], rule: lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
- sms: { i18n: { plural: { keys: [:one, :two, :other], rule: lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
- so: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- sq: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- sr: { i18n: { plural: { keys: [:one, :few, :other], rule: lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : :other } } } },
- sv: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- sw: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- ta: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- te: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- th: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- ti: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
- tk: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- tl: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
- to: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- tr_TR: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- ug: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- # TODO put this back when translations are correct: :uk => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
- uk: { i18n: { plural: { keys: [:one, :few, :other], rule: lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :other : :other } } } },
- ur: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } },
- vi: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- wa: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
- yo: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- zh: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- zh_CN: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- zh_TW: { i18n: { plural: { keys: [:other], rule: lambda { |n| :other } } } },
- zu: { i18n: { plural: { keys: [:one, :other], rule: lambda { |n| n == 1 ? :one : :other } } } }
+ af: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ ak: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ ((n.to_f % 1).zero? && (0..1).include?(n.to_f)) ? :one : :other
+ end,
+ },
+ },
+ },
+ am: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 0 || n.to_f == 1) ? :one : :other
+ end,
+ },
+ },
+ },
+ ar: {
+ i18n: {
+ plural: {
+ keys: %i[zero one two few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 0 ?
+ :zero :
+ n.to_f == 1 ?
+ :one :
+ n.to_f == 2 ?
+ :two :
+ (((n.to_f % 100) % 1).zero? && (3..10).include?(n.to_f % 100)) ?
+ :few :
+ (((n.to_f % 100) % 1).zero? && (11..99).include?(n.to_f % 100)) ? :many : :other
+ end,
+ },
+ },
+ },
+ asa: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ as: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 0 || n.to_f == 1) ? :one : :other
+ end,
+ },
+ },
+ },
+ ast: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ az: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ bem: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ be: {
+ i18n: {
+ plural: {
+ keys: %i[one few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_f % 10 == 1 && n.to_f % 100 != 11) ?
+ :one :
+ (
+ (((n.to_f % 10) % 1).zero? && (2..4).include?(n.to_f % 10)) &&
+ (((n.to_f % 100) % 1).zero? && !(12..14).include?(n.to_f % 100))
+ ) ?
+ :few :
+ if (
+ n.to_f % 10 == 0 ||
+ (((n.to_f % 10) % 1).zero? && (5..9).include?(n.to_f % 10)) ||
+ (((n.to_f % 100) % 1).zero? && (11..14).include?(n.to_f % 100))
+ )
+ :many
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ bez: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ bg: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ bm: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ bn: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 0 || n.to_f == 1) ? :one : :other
+ end,
+ },
+ },
+ },
+ bo: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ br: {
+ i18n: {
+ plural: {
+ keys: %i[one two few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_f % 10 == 1 && ![11, 71, 91].include?(n.to_f % 100)) ?
+ :one :
+ (n.to_f % 10 == 2 && ![12, 72, 92].include?(n.to_f % 100)) ?
+ :two :
+ (
+ (
+ (n.to_f % 10) == 9 ||
+ (((n.to_f % 10) % 1).zero? && (3..4).include?(n.to_f % 10))
+ ) &&
+ (
+ (
+ ((n.to_f % 100) % 1).zero? &&
+ (
+ !(10..19).include?(n.to_f % 100) || !(70..79).include?(n.to_f % 100) ||
+ !(90..99).include?(n.to_f % 100)
+ )
+ )
+ )
+ ) ?
+ :few :
+ (n.to_f != 0 && n.to_f % 1_000_000 == 0) ? :many : :other
+ end,
+ },
+ },
+ },
+ brx: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ bs_BA: {
+ i18n: {
+ plural: {
+ keys: %i[one few other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 10 == 1 &&
+ n.to_i % 100 != 11
+ ) ||
+ (
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 10 == 1 &&
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100 != 11
+ )
+ ) ?
+ :one :
+ if (
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ (2..4).include?(n.to_i % 10) && !(12..14).include?(n.to_i % 100)
+ ) ||
+ (
+ (2..4).include?(((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 10) &&
+ !(12..14).include?(((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100)
+ )
+ )
+ :few
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ ca: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ ceb: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ if (
+ (((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && [1, 2, 3].include?(n.to_i)) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ ![4, 6, 9].include?(n.to_i % 10)
+ ) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) != 0 &&
+ ![4, 6, 9].include?(((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 10)
+ )
+ )
+ :one
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ ce: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ cgg: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ chr: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ ckb: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ cs: {
+ i18n: {
+ plural: {
+ keys: %i[one few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ?
+ :one :
+ ((2..4).include?(n.to_i) && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ?
+ :few :
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) != 0 ? :many : :other
+ end,
+ },
+ },
+ },
+ cy: {
+ i18n: {
+ plural: {
+ keys: %i[zero one two few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 0 ?
+ :zero :
+ n.to_f == 1 ?
+ :one :
+ n.to_f == 2 ? :two : n.to_f == 3 ? :few : n.to_f == 6 ? :many : :other
+ end,
+ },
+ },
+ },
+ da: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ if (
+ n.to_f == 1 ||
+ (
+ ((t = n.to_s.split(".")[1]) ? t.gsub(/0+$/, "").to_i : 0) != 0 &&
+ [0, 1].include?(n.to_i)
+ )
+ )
+ :one
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ de: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ doi: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 0 || n.to_f == 1) ? :one : :other
+ end,
+ },
+ },
+ },
+ dsb: {
+ i18n: {
+ plural: {
+ keys: %i[one two few other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (
+ (((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 100 == 1) ||
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100 == 1
+ ) ?
+ :one :
+ (
+ (((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 100 == 2) ||
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100 == 2
+ ) ?
+ :two :
+ if (
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ (3..4).include?(n.to_i % 100)
+ ) || (3..4).include?(((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100)
+ )
+ :few
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ dz: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ ee: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ el: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ en: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ en_GB: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ eo: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ es: {
+ i18n: {
+ plural: {
+ keys: %i[one many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ?
+ :one :
+ if (
+ (
+ (e = 0) == 0 && n.to_i != 0 && n.to_i % 1_000_000 == 0 &&
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0
+ ) || !(0..5).include?(e = 0)
+ )
+ :many
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ et: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ eu: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ fa_IR: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 0 || n.to_f == 1) ? :one : :other
+ end,
+ },
+ },
+ },
+ ff: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ [0, 1].include?(n.to_i) ? :one : :other
+ end,
+ },
+ },
+ },
+ fil: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ if (
+ (((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && [1, 2, 3].include?(n.to_i)) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ ![4, 6, 9].include?(n.to_i % 10)
+ ) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) != 0 &&
+ ![4, 6, 9].include?(((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 10)
+ )
+ )
+ :one
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ fi: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ fo: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ fr: {
+ i18n: {
+ plural: {
+ keys: %i[one many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ [0, 1].include?(n.to_i) ?
+ :one :
+ if (
+ (
+ (e = 0) == 0 && n.to_i != 0 && n.to_i % 1_000_000 == 0 &&
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0
+ ) || !(0..5).include?(e = 0)
+ )
+ :many
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ fur: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ fy: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ ga: {
+ i18n: {
+ plural: {
+ keys: %i[one two few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ?
+ :one :
+ n.to_f == 2 ?
+ :two :
+ ((n.to_f % 1).zero? && (3..6).include?(n.to_f)) ?
+ :few :
+ ((n.to_f % 1).zero? && (7..10).include?(n.to_f)) ? :many : :other
+ end,
+ },
+ },
+ },
+ gd: {
+ i18n: {
+ plural: {
+ keys: %i[one two few other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ [1, 11].include?(n.to_f) ?
+ :one :
+ [2, 12].include?(n.to_f) ?
+ :two :
+ if (((n.to_f % 1).zero? && ((3..10).include?(n.to_f) || (13..19).include?(n.to_f))))
+ :few
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ gl: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ gsw: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ gu: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 0 || n.to_f == 1) ? :one : :other
+ end,
+ },
+ },
+ },
+ gv: {
+ i18n: {
+ plural: {
+ keys: %i[one two few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 10 == 1) ?
+ :one :
+ (((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 10 == 2) ?
+ :two :
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ [0, 20, 40, 60, 80].include?(n.to_i % 100)
+ ) ?
+ :few :
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) != 0 ? :many : :other
+ end,
+ },
+ },
+ },
+ ha: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ haw: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ he: {
+ i18n: {
+ plural: {
+ keys: %i[one two many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ?
+ :one :
+ (n.to_i == 2 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ?
+ :two :
+ if (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ ((n.to_f % 1).zero? && !(0..10).include?(n.to_f)) && n.to_f % 10 == 0
+ )
+ :many
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ hi: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 0 || n.to_f == 1) ? :one : :other
+ end,
+ },
+ },
+ },
+ hr: {
+ i18n: {
+ plural: {
+ keys: %i[one few other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 10 == 1 &&
+ n.to_i % 100 != 11
+ ) ||
+ (
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 10 == 1 &&
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100 != 11
+ )
+ ) ?
+ :one :
+ if (
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ (2..4).include?(n.to_i % 10) && !(12..14).include?(n.to_i % 100)
+ ) ||
+ (
+ (2..4).include?(((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 10) &&
+ !(12..14).include?(((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100)
+ )
+ )
+ :few
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ hsb: {
+ i18n: {
+ plural: {
+ keys: %i[one two few other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (
+ (((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 100 == 1) ||
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100 == 1
+ ) ?
+ :one :
+ (
+ (((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 100 == 2) ||
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100 == 2
+ ) ?
+ :two :
+ if (
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ (3..4).include?(n.to_i % 100)
+ ) || (3..4).include?(((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100)
+ )
+ :few
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ hu: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ hy: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ [0, 1].include?(n.to_i) ? :one : :other
+ end,
+ },
+ },
+ },
+ ia: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ id: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ ig: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ ii: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ is: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ if (
+ (
+ ((t = n.to_s.split(".")[1]) ? t.gsub(/0+$/, "").to_i : 0) == 0 &&
+ n.to_i % 10 == 1 && n.to_i % 100 != 11
+ ) || ((t = n.to_s.split(".")[1]) ? t.gsub(/0+$/, "").to_i : 0) != 0
+ )
+ :one
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ it: {
+ i18n: {
+ plural: {
+ keys: %i[one many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ?
+ :one :
+ if (
+ (
+ (e = 0) == 0 && n.to_i != 0 && n.to_i % 1_000_000 == 0 &&
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0
+ ) || !(0..5).include?(e = 0)
+ )
+ :many
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ ja: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ jgo: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ jmc: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ jv: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ kab: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ [0, 1].include?(n.to_i) ? :one : :other
+ end,
+ },
+ },
+ },
+ ka: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ kde: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ kea: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ kkj: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ kk: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ kl: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ km: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ kn: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 0 || n.to_f == 1) ? :one : :other
+ end,
+ },
+ },
+ },
+ ko: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ ksb: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ ksh: {
+ i18n: {
+ plural: {
+ keys: %i[zero one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 0 ? :zero : n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ ks: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ ku: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ kw: {
+ i18n: {
+ plural: {
+ keys: %i[zero one two few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 0 ?
+ :zero :
+ n.to_f == 1 ?
+ :one :
+ (
+ [2, 22, 42, 62, 82].include?(n.to_f % 100) ||
+ (
+ n.to_f % 1000 == 0 &&
+ (
+ [40_000, 60_000, 80_000].include?(n.to_f % 100_000) ||
+ (
+ ((n.to_f % 100_000) % 1).zero? &&
+ (1000..20_000).include?(n.to_f % 100_000)
+ )
+ )
+ ) || (n.to_f != 0 && n.to_f % 1_000_000 == 100_000)
+ ) ?
+ :two :
+ [3, 23, 43, 63, 83].include?(n.to_f % 100) ?
+ :few :
+ (n.to_f != 1 && [1, 21, 41, 61, 81].include?(n.to_f % 100)) ? :many : :other
+ end,
+ },
+ },
+ },
+ ky: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ lag: {
+ i18n: {
+ plural: {
+ keys: %i[zero one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 0 ? :zero : ([0, 1].include?(n.to_i) && n.to_f != 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ lb: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ lg: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ lkt: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ ln: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ ((n.to_f % 1).zero? && (0..1).include?(n.to_f)) ? :one : :other
+ end,
+ },
+ },
+ },
+ lo: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ lt: {
+ i18n: {
+ plural: {
+ keys: %i[one few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_f % 10 == 1 && (((n.to_f % 100) % 1).zero? && !(11..19).include?(n.to_f % 100))) ?
+ :one :
+ (
+ (((n.to_f % 10) % 1).zero? && (2..9).include?(n.to_f % 10)) &&
+ (((n.to_f % 100) % 1).zero? && !(11..19).include?(n.to_f % 100))
+ ) ?
+ :few :
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) != 0 ? :many : :other
+ end,
+ },
+ },
+ },
+ lv: {
+ i18n: {
+ plural: {
+ keys: %i[zero one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (
+ n.to_f % 10 == 0 || (((n.to_f % 100) % 1).zero? && (11..19).include?(n.to_f % 100)) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 2 &&
+ (11..19).include?(((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100)
+ )
+ ) ?
+ :zero :
+ if (
+ (n.to_f % 10 == 1 && n.to_f % 100 != 11) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 2 &&
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 10 == 1 &&
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100 != 11
+ ) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) != 2 &&
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 10 == 1
+ )
+ )
+ :one
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ mas: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ mgo: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ mg: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ ((n.to_f % 1).zero? && (0..1).include?(n.to_f)) ? :one : :other
+ end,
+ },
+ },
+ },
+ mk: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ if (
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 10 == 1 &&
+ n.to_i % 100 != 11
+ ) ||
+ (
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 10 == 1 &&
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100 != 11
+ )
+ )
+ :one
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ ml: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ mn: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ mr: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ ms: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ mt: {
+ i18n: {
+ plural: {
+ keys: %i[one few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ?
+ :one :
+ (n.to_f == 0 || (((n.to_f % 100) % 1).zero? && (2..10).include?(n.to_f % 100))) ?
+ :few :
+ (((n.to_f % 100) % 1).zero? && (11..19).include?(n.to_f % 100)) ? :many : :other
+ end,
+ },
+ },
+ },
+ my: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ naq: {
+ i18n: {
+ plural: {
+ keys: %i[one two other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : n.to_f == 2 ? :two : :other
+ end,
+ },
+ },
+ },
+ nb_NO: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ nd: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ ne: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ nl: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ nnh: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ nn: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ no: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ nyn: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ om: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ or: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ os: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ pa: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ ((n.to_f % 1).zero? && (0..1).include?(n.to_f)) ? :one : :other
+ end,
+ },
+ },
+ },
+ pcm: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 0 || n.to_f == 1) ? :one : :other
+ end,
+ },
+ },
+ },
+ pl_PL: {
+ i18n: {
+ plural: {
+ keys: %i[one few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ?
+ :one :
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && (2..4).include?(n.to_i % 10) &&
+ !(12..14).include?(n.to_i % 100)
+ ) ?
+ :few :
+ if (
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i != 1 &&
+ (0..1).include?(n.to_i % 10)
+ ) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ (5..9).include?(n.to_i % 10)
+ ) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ (12..14).include?(n.to_i % 100)
+ )
+ )
+ :many
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ ps: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ pt_BR: {
+ i18n: {
+ plural: {
+ keys: %i[one many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (0..1).include?(n.to_i) ?
+ :one :
+ if (
+ (
+ (e = 0) == 0 && n.to_i != 0 && n.to_i % 1_000_000 == 0 &&
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0
+ ) || !(0..5).include?(e = 0)
+ )
+ :many
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ pt: {
+ i18n: {
+ plural: {
+ keys: %i[one many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ?
+ :one :
+ if (
+ (
+ (e = 0) == 0 && n.to_i != 0 && n.to_i % 1_000_000 == 0 &&
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0
+ ) || !(0..5).include?(e = 0)
+ )
+ :many
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ rm: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ rof: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ ro: {
+ i18n: {
+ plural: {
+ keys: %i[one few other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ?
+ :one :
+ if (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) != 0 || n.to_f == 0 ||
+ (((n.to_f % 100) % 1).zero? && (2..19).include?(n.to_f % 100))
+ )
+ :few
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ ru: {
+ i18n: {
+ plural: {
+ keys: %i[one few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 10 == 1 &&
+ n.to_i % 100 != 11
+ ) ?
+ :one :
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && (2..4).include?(n.to_i % 10) &&
+ !(12..14).include?(n.to_i % 100)
+ ) ?
+ :few :
+ if (
+ (((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 10 == 0) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ (5..9).include?(n.to_i % 10)
+ ) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ (11..14).include?(n.to_i % 100)
+ )
+ )
+ :many
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ rwk: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ sah: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ saq: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ sat: {
+ i18n: {
+ plural: {
+ keys: %i[one two other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : n.to_f == 2 ? :two : :other
+ end,
+ },
+ },
+ },
+ sc: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ sd: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ seh: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ se: {
+ i18n: {
+ plural: {
+ keys: %i[one two other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : n.to_f == 2 ? :two : :other
+ end,
+ },
+ },
+ },
+ ses: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ sg: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ shi: {
+ i18n: {
+ plural: {
+ keys: %i[one few other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 0 || n.to_f == 1) ?
+ :one :
+ ((n.to_f % 1).zero? && (2..10).include?(n.to_f)) ? :few : :other
+ end,
+ },
+ },
+ },
+ si: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ if (
+ [0, 1].include?(n.to_f) ||
+ (n.to_i == 0 && ((f = n.to_s.split(".")[1]) ? f.to_i : 0) == 1)
+ )
+ :one
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ sk: {
+ i18n: {
+ plural: {
+ keys: %i[one few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ?
+ :one :
+ ((2..4).include?(n.to_i) && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ?
+ :few :
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) != 0 ? :many : :other
+ end,
+ },
+ },
+ },
+ sl: {
+ i18n: {
+ plural: {
+ keys: %i[one two few other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 100 == 1) ?
+ :one :
+ (((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 100 == 2) ?
+ :two :
+ if (
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ (3..4).include?(n.to_i % 100)
+ ) || ((v = n.to_s.split(".")[1]) ? v.length : 0) != 0
+ )
+ :few
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ smn: {
+ i18n: {
+ plural: {
+ keys: %i[one two other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : n.to_f == 2 ? :two : :other
+ end,
+ },
+ },
+ },
+ sn: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ so: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ sq: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ sr: {
+ i18n: {
+ plural: {
+ keys: %i[one few other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 10 == 1 &&
+ n.to_i % 100 != 11
+ ) ||
+ (
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 10 == 1 &&
+ ((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100 != 11
+ )
+ ) ?
+ :one :
+ if (
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ (2..4).include?(n.to_i % 10) && !(12..14).include?(n.to_i % 100)
+ ) ||
+ (
+ (2..4).include?(((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 10) &&
+ !(12..14).include?(((f = n.to_s.split(".")[1]) ? f.to_i : 0) % 100)
+ )
+ )
+ :few
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ su: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ sv: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ sw: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ ta: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ teo: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ te: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ th: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ ti: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ ((n.to_f % 1).zero? && (0..1).include?(n.to_f)) ? :one : :other
+ end,
+ },
+ },
+ },
+ tk: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ to: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ tr_TR: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ tzm: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ if (
+ ((n.to_f % 1).zero? && (0..1).include?(n.to_f)) ||
+ ((n.to_f % 1).zero? && (11..99).include?(n.to_f))
+ )
+ :one
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ ug: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ uk: {
+ i18n: {
+ plural: {
+ keys: %i[one few many other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 10 == 1 &&
+ n.to_i % 100 != 11
+ ) ?
+ :one :
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && (2..4).include?(n.to_i % 10) &&
+ !(12..14).include?(n.to_i % 100)
+ ) ?
+ :few :
+ if (
+ (((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 && n.to_i % 10 == 0) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ (5..9).include?(n.to_i % 10)
+ ) ||
+ (
+ ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0 &&
+ (11..14).include?(n.to_i % 100)
+ )
+ )
+ :many
+ else
+ :other
+ end
+ end,
+ },
+ },
+ },
+ ur: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ uz: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ vi: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ vun: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ wae: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ wo: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ xh: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ xog: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ n.to_f == 1 ? :one : :other
+ end,
+ },
+ },
+ },
+ yi: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 1 && ((v = n.to_s.split(".")[1]) ? v.length : 0) == 0) ? :one : :other
+ end,
+ },
+ },
+ },
+ yo: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ yue: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ zh_CN: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ zh_TW: {
+ i18n: {
+ plural: {
+ keys: [:other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ :other
+ end,
+ },
+ },
+ },
+ zu: {
+ i18n: {
+ plural: {
+ keys: %i[one other],
+ rule:
+ lambda do |n|
+ n = n.respond_to?(:abs) ? n.abs : ((m = n.to_s)[0] == "-" ? m[1, m.length] : m)
+ (n.to_i == 0 || n.to_f == 1) ? :one : :other
+ end,
+ },
+ },
+ },
}