Tuesday, July 13, 2010

Plurarize word in I18n structure yml file

Here's the rules of pluralization texts, for example:

In English language

en:
   blog:
     view:
       one: "1 View"
       other: "{{count}} Views"


In Indonesia language

id:
   blog:
     view:
       one: "1 Terlihat"
       other: "{{count}} Kali terlihat"


well, you can call this code in View :


<%= t('blog.view', :count => number) %>

No comments:

Post a Comment