Use HTML inside a Rails translation file

Other than using raw, there’s an other undocumented (but official) way to do so.
All keys ending with _html are automatically rendered unescaped.

Rename the key from

teasers:
    welcome: "<strong>Welcome</strong> to the Website ..."

to

teasers:
    welcome_html: "<strong>Welcome</strong> to the Website ..."

Leave a Comment