Sha256: 923462765001966777892abc7bc42c56565e901921876f552e6cb96680f5ac73

Contents?: true

Size: 559 Bytes

Versions: 27

Compression:

Stored size: 559 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 = {})
      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

Version data entries

27 entries across 27 versions & 4 rubygems

Version Path
will_paginate-3.2.1 lib/will_paginate/i18n.rb
will_paginate-3.2.0 lib/will_paginate/i18n.rb
will_paginate-3.1.8 lib/will_paginate/i18n.rb
will_paginate-3.1.7 lib/will_paginate/i18n.rb
will_paginate-3.1.6 lib/will_paginate/i18n.rb
will_paginate-3.0.12 lib/will_paginate/i18n.rb
will_paginate-3.1.5 lib/will_paginate/i18n.rb
will_paginate-3.0.11 lib/will_paginate/i18n.rb
will_paginate-3.1.3 lib/will_paginate/i18n.rb
will_paginate-3.0.10 lib/will_paginate/i18n.rb
will_paginate-3.0.9 lib/will_paginate/i18n.rb
will_paginate-3.1.2 lib/will_paginate/i18n.rb
will_paginate-3.1.1 lib/will_paginate/i18n.rb
will_paginate-3.0.8 lib/will_paginate/i18n.rb
will_paginate-3.1.0 lib/will_paginate/i18n.rb
will_paginate_seo-3.0.4 lib/will_paginate/i18n.rb
will_paginate-3.0.7 lib/will_paginate/i18n.rb
will_paginate-3.0.6 lib/will_paginate/i18n.rb
hobo_will_paginate-2.1.1 lib/will_paginate/i18n.rb
hobo_will_paginate-2.1.0 lib/will_paginate/i18n.rb