Sha256: 30a5dbcd9f8be46cfd313e58a8394f721aa684337fca37db33224084af4ceea4

Contents?: true

Size: 707 Bytes

Versions: 25

Compression:

Stored size: 707 Bytes

Contents

# frozen_string_literal: true

{
  en: {
    number: {
      nth: {
        ordinals: lambda do |_key, number:, **_options|
          case number
          when 1; "st"
          when 2; "nd"
          when 3; "rd"
          when 4, 5, 6, 7, 8, 9, 10, 11, 12, 13; "th"
          else
            num_modulo = number.to_i.abs % 100
            num_modulo %= 10 if num_modulo > 13
            case num_modulo
            when 1; "st"
            when 2; "nd"
            when 3; "rd"
            else    "th"
            end
          end
        end,

        ordinalized: lambda do |_key, number:, **_options|
          "#{number}#{ActiveSupport::Inflector.ordinal(number)}"
        end
      }
    }
  }
}

Version data entries

25 entries across 23 versions & 5 rubygems

Version Path
activesupport-6.0.2.2 lib/active_support/locale/en.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.1/lib/active_support/locale/en.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.1/lib/active_support/locale/en.rb
activesupport-6.0.2.1 lib/active_support/locale/en.rb
activesupport-6.0.2 lib/active_support/locale/en.rb
activesupport-6.0.2.rc2 lib/active_support/locale/en.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/activesupport-6.0.0/lib/active_support/locale/en.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/locale/en.rb
activesupport-6.0.2.rc1 lib/active_support/locale/en.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/locale/en.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/activesupport-6.0.0/lib/active_support/locale/en.rb
activesupport-6.0.1 lib/active_support/locale/en.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.0/lib/active_support/locale/en.rb
activesupport-6.0.1.rc1 lib/active_support/locale/en.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.0/lib/active_support/locale/en.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/activesupport-6.0.0/lib/active_support/locale/en.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/activesupport-6.0.0/lib/active_support/locale/en.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/activesupport-6.0.0/lib/active_support/locale/en.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/activesupport-6.0.0/lib/active_support/locale/en.rb
activesupport-6.0.0 lib/active_support/locale/en.rb