Sha256: c37236da1b1078db7f1f8ba33b81f1b85abaf78e716ff4676ae39257c71926f9
Contents?: true
Size: 566 Bytes
Versions: 6
Compression:
Stored size: 566 Bytes
Contents
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 = {}, &block) if defined? ::I18n defaults = Array(keys).dup 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 end end
Version data entries
6 entries across 5 versions & 2 rubygems