diff --git a/lib/will_paginate/view_helpers/base.rb b/lib/will_paginate/view_helpers/base.rb index 73c8375e8..f23819893 100644 --- a/lib/will_paginate/view_helpers/base.rb +++ b/lib/will_paginate/view_helpers/base.rb @@ -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