lib/will_paginate/i18n.rb in will_paginate-3.2.1 vs lib/will_paginate/i18n.rb in will_paginate-3.3.0
- old
+ new
@@ -6,14 +6,14 @@
def self.load_path
Dir["#{locale_dir}/*.{rb,yml}"]
end
- def will_paginate_translate(keys, options = {})
+ def will_paginate_translate(keys, options = {}, &block)
if defined? ::I18n
defaults = Array(keys).dup
- defaults << Proc.new if block_given?
- ::I18n.translate(defaults.shift, options.merge(:default => defaults, :scope => :will_paginate))
+ defaults << block if block_given?
+ ::I18n.translate(defaults.shift, **options.merge(:default => defaults, :scope => :will_paginate))
else
key = Array === keys ? keys.first : keys
yield key, options
end
end