Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 23 lines (20 sloc) 0.559 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
module WillPaginate
  module I18n
    def self.locale_dir
      File.expand_path('../locale', __FILE__)
    end

    def self.load_path
      Dir["#{locale_dir}/*.{rb,yml}"]
    end

    def will_paginate_translate(keys, options = {})
      if defined? ::I18n
        defaults = Array(keys).dup
        defaults << Proc.new 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
  end
end
Something went wrong with that request. Please try again.