i18n links that include Bootstrap icons

April 10, 2012

After getting the bootstrap icons to show up last time, the next thing to try out was internationalization. Again after searching this way and that way, this is what came out.

Previous code

<%= link_to raw('<i class="icon-ok-circle icon-white"></i>' ' Sign up now'), new_user_registration_path, class: "btn btn-large btn-success"%>

Updated code

<%= link_to new_user_registration_path, :class => 'btn btn-large btn-success' do %>
 <i class="icon-ok-circle icon-white"></i>
 <%= t(:signupnow).html_safe %>
<% end %>

Discussion, links, and tweets

Good Morning!