Skip to content

Commit

Permalink
minor i18n fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Aug 9, 2011
1 parent 89cf147 commit c3ebc51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/will_paginate/i18n.rb
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions lib/will_paginate/view_helpers.rb
Expand Up @@ -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'
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c3ebc51

Please sign in to comment.