Wednesday, May 2, 2012

Parameterizing translation files in rails I18n

In en.yml,

delete_confirm_with_title: 'Are you sure, you want to delete "%{title}"?'

In erb
<%= link_to 'X', resource, confirm: t('delete_confirm_with_title', {:title => resource.name}), method: :delete %>

No comments: