I18n with arguments

suggest change

You can pass parameters to I18n t method:

# Example config/locales/en.yml
en:
  page:
    users: "%{users_count} users currently online"

# In models, controller, etc...
I18n.t('page.users', users_count: 12)

# In views

# ERB
<%= t('page.users', users_count: 12) %>

#SLIM
= t('page.users', users_count: 12)

# Shortcut in views - DRY!
# Use only the dot notation
# Important: Consider you have the following controller and view page#users

# ERB Example app/views/page/users.html.erb
<%= t('.users', users_count: 12) %>

And get the following output:

"12 users currently online"

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


I18N - internalization:
*I18n with arguments

Table Of Contents
16I18N - internalization
55CSV