Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I localize will_paginate in ruby on rails?

I like to localize the "previous" and "next" links in will_paginate, how can I do that? Did anyone find a nice workaround?

like image 425
tabaluga Avatar asked Jul 09 '10 09:07

tabaluga


1 Answers

In case someone else found the thread..., there is an another solution now.

https://github.com/mislav/will_paginate/wiki/I18n

The following is extracted from the above link.

As of will_paginate v2.3.16 and v3.0, some output of will_paginate view helper and the complete output of page_entries_info helper can be translated by means of the i18n library.

In Rails, this usually means adding your translations in YAML or ruby format in the "config/locale/" directory.

Translation keys and default values for the will_paginate helper can be seen here:


en:
  will_paginate:
    previous_label: "Previous"
    next_label: "Next"
    page_gap: "…"

like image 127
William L. Avatar answered Sep 18 '22 15:09

William L.