How to use pluralization in with I18n

This article is quite old.Time flies when you're having fun. I've been writing for my blog for a long time. Stuff changes fast, especially in the Ruby world. That's why I've put this warning on old posts. The article might still be valid, though.

Pluralization Rails 2.2 style

Railscast episode 132 talks about using helpers outside views. All in all a good and useful screencast. I only have one comment: In Rails 2.2 internationalized pluralization goes like this:

I18n.t(:people, :count => @people.size)

With these translation-files:

en:
  people:
    one: "one person"
    other: "%{count} people"
nl:
  people:
    one: "een persoon"
    other: "%{count} personen"
comments powered byDisqus