tell me the best way to use i18n with lots of html tags on rails?

You might want to have localized snippets for the whole thing instead (Rails Guides: Localized views):

spanish version in own file

<p>Através dos princípios da<strong> economia colaborativa </strong> e do <strong>
      <span id="yellow">poder da tecnologia</span></strong> nosso modelo de negócio
alia a <strong> <span id="green"> expertise do executive search </span></strong>
 <strong><span id="red">, a </span></strong>importância das relações humanas <strong> e o<span id="blue">alcance das redes</span>

and then the english one

# marketing.en.erb
<p>Something<strong> in english</strong>...  <strong>
      <span id="yellow">... </span></strong>

And automatically include the correct partial

(other content)
<%= render :marketing %>

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top