Ruby on Rails - use i18n with html tags and symbols in ruby on rails- ruby on rails tutorial - rails guides - rails tutorial - ruby rails
Use I18n with HTML Tags and Symbols
# config/locales/en.yml
en:
stackoverflow:
header:
title_html: "Use <strong>I18n</strong> with Tags & Symbols"
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - ruby on rails tutorial - rails guides - ruby rails - rubyonrails - learn ruby on rails - team
Note: the addition of extra _html after the name title.
Output
# ERB
<h2><%= t(:title_html, scope: [:stackoverflow, :header]) %></h2>