Skip to content

Commit

Permalink
aasdad
Browse files Browse the repository at this point in the history
  • Loading branch information
developer committed Mar 28, 2011
1 parent b1a5bee commit 5715ff5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/will_paginate/view_helpers/base.rb
Expand Up @@ -107,14 +107,20 @@ def page_entries_info(collection, options = {})
sp = ' '
end

no = options[:no] || "No";
found = options[:found] || "found";
of = options[:of] || "of";
displaying = options[:displaying] || "Displaying";
in_total = options[:in_total] || "in total";

if collection.total_pages < 2
case collection.size
when 0; "No #{plural_name} found"
when 1; "Displaying #{b}1#{eb} #{entry_name}"
else; "Displaying #{b}all #{collection.size}#{eb} #{plural_name}"
when 0; "#{no} #{plural_name} #{found}"
when 1; "#{displaying} #{b}1#{eb} #{entry_name}"
else; "#{displaying} #{b}all #{collection.size}#{eb} #{plural_name}"
end
else
%{Displaying #{plural_name} #{b}%d#{sp}-#{sp}%d#{eb} of #{b}%d#{eb} in total} % [
%{#{displaying} #{plural_name} #{b}%d#{sp}-#{sp}%d#{eb} #{of} #{b}%d#{eb} #{in_total}} % [
collection.offset + 1,
collection.offset + collection.length,
collection.total_entries
Expand Down

0 comments on commit 5715ff5

Please sign in to comment.