Permalink
Browse files

minor i18n fixes

  • Loading branch information...
1 parent 89cf147 commit c3ebc51ed815927fecb383219e49782a0ef1708f @mislav committed Aug 8, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −0 lib/will_paginate/i18n.rb
  2. +2 −3 lib/will_paginate/view_helpers.rb
@@ -14,6 +14,7 @@ def will_paginate_translate(keys, options = {})
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
@@ -97,7 +97,6 @@ def will_paginate(collection, options = {})
#
# The default output contains HTML. Use ":html => false" for plain text.
def page_entries_info(collection, options = {})
- html = options[:html] != false
model = options[:model]
model = collection.first.class unless model or collection.empty?
model ||= 'entry'
@@ -107,7 +106,7 @@ def page_entries_info(collection, options = {})
model.to_s.underscore
end
- if html
+ if options.fetch(:html, true)
b, eb = '<b>', '</b>'
sp = '&nbsp;'
html_key = '_html'
@@ -137,7 +136,7 @@ def page_entries_info(collection, options = {})
case opts[:count]
when 0; "No #{opts[:model]} found"
when 1; "Displaying #{b}1#{eb} #{opts[:model]}"
- else "Displaying #{b}all #{opts[:count]}#{eb} #{opts[:model]}"
+ else "Displaying #{b}all#{sp}#{opts[:count]}#{eb} #{opts[:model]}"
end
end
else

0 comments on commit c3ebc51

Please sign in to comment.