Skip to content

Commit

Permalink
I18N[:plurals] proc uses symbols and returns a frozen string
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed May 18, 2018
1 parent 6ea7a48 commit 987be15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pagy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.root; Pathname.new(__FILE__).dirname end
VARS = { items:20, outset:0, size:[1,4,4,1] }

# default I18n vars
zero_one = %w[zero one].freeze ; I18N = { file: Pagy.root.join('locales', 'pagy.yml').to_s, plurals: -> (c) {zero_one[c] || 'other'} }
zero_one = [:zero, :one] ; I18N = { file: Pagy.root.join('locales', 'pagy.yml').to_s, plurals: -> (c) {(zero_one[c] || :other).to_s.freeze} }


attr_reader :count, :page, :items, :vars, :pages, :last, :offset, :from, :to, :prev, :next
Expand Down

0 comments on commit 987be15

Please sign in to comment.