Skip to content

Instantly share code, notes, and snippets.

@mislav
Created August 4, 2011 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mislav/1126376 to your computer and use it in GitHub Desktop.
Save mislav/1126376 to your computer and use it in GitHub Desktop.
will_paginate i18n keys

Variations of output:

  1. No users found
  2. Displaying 1 user
  3. Displaying all 27 users
  4. Displaying users 12 - 18 of 27 in total

The problem is, "user/users" is a variable name since this view helpers accepts collections of any kind of objects. So I've really got 2 dimensions for i18n:

  1. translation for the name of the object ("User" in this case) and its plural form
  2. translation of view helper output outlined above.

Below are translations that handle scenario 2), but I have no inspiration about 1).

en:
views:
will_paginate:
previous_label: "← Previous"
next_label: "Next →"
page_gap: "…"
page_entries_info:
single_page:
zero: "No %{plural} found"
one: "Displaying 1 %{name}"
other: "Displaying all %{count} %{plural}"
multi_page: "Displaying %{plural} %{from} - %{to} of %{total} in total"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment