title: rails i18n - translating text with links inside
body: <p>I'd like to i18n a text that looks like this:</p>
  
  <blockquote>
    <p>Already signed up? <a href="http://example.com" rel="noreferrer">Log in!</a></p>
  </blockquote>
  
  <p>Note that there is a link on the text. On this example it points to google - in reality it will point to my app's <code>log_in_path</code>.</p>
  
  <p>I've found two ways of doing this, but none of them looks "right".</p>
  
  <p>The first way I know involves having this my <code>en.yml</code>:</p>
  
  <pre><code>log_in_message: "Already signed up? &lt;a href='{{url}}'&gt;Log in!&lt;/a&gt;"
  </code></pre>
  
  <p>And in my view:</p>
  
  <pre><code>&lt;p&gt; &lt;%= t('log_in_message', :url =&gt; login_path) %&gt; &lt;/p&gt;
  </code></pre>
  
  <p>This <em>works</em>, but having the <code>&lt;a href=...&lt;/a&gt;</code> part on the <code>en.yml</code> doesn't look very clean to me.</p>
  
  <p>The other option I know is using <a href="http://guides.rubyonrails.org/i18n.html#localized-views" rel="noreferrer">localized views</a> - <code>login.en.html.erb</code>, and <code>login.es.html.erb</code>.</p>
  
  <p>This also doesn't feel right since the only different line would be the aforementioned one; the rest of the view (~30 lines) would be repeated for all views. It would not be very DRY.</p>
  
  <p>I guess I could use "localized partials" but that seems too cumberstone; I think I prefer the first option to having so many tiny view files.</p>
  
  <p>So my question is: is there a "proper" way to implement this?</p>