Quantcast
Channel: iain.nl
Viewing all articles
Browse latest Browse all 133

Pluralization Rails 2.2 style

$
0
0

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"

Viewing all articles
Browse latest Browse all 133

Trending Articles