Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>No, there isn't a cleaner way of dealing with this. If you want pull the <code>url</code> out of the string then you're stuck breaking the sentence into four pieces:</p> <ol> <li><code>"Go</code>.</li> <li><code>&lt;a href="{{url}}"&gt;...&lt;/a&gt;</code></li> <li><code>'here'</code></li> <li><code>'for expert security advice.'</code></li> </ol> <p>These four pieces are easy to put back together in English but the order might change in other languages and that can change the capitalization of <em>here</em> and cause other problems. To get it right, you'd have to structure things like this:</p> <pre><code>here = "&lt;a href=\"#{url}\"&gt;#{t(:expert_security_advice_here)}&lt;/a&gt;" whole_thing = t(:expert_security_advice, :here =&gt; here) </code></pre> <p>and the two separate strings in your YAML:</p> <pre><code>expert_security_advice_here: "here" expert_security_advice: "Go {{here}} for expert security advice." </code></pre> <p>You'd also have to tell the translators that those two pieces of text go together.</p> <p>If that sort of thing seems cleaner to you then go for it but I wouldn't worry about small bits of HTML in text that needs to be translated, any translator worth talking to will be able to handle it. Never try to take shortcuts with I18N/L10N issues, they will always lead you astray and cause problems: non-DRY code (WET code?) is always better than broken code.</p> <hr> <p>As an aside, I'd recommend that you drop the standard Rails I18N string handling tools in favor of <a href="https://github.com/grosser/gettext_i18n_rails" rel="nofollow">gettext</a>, keeping everything synchronized with gettext is much easier and the code ends up being much easier to read.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload