在 rails 上使用带有许多 html 标签的 i18n 的正确或最佳方法是什么?

Which is the proper or best way to use i18n with many html tags on rails?

我有一个类似的代码需要添加到 i18n,我想知道 best/safest 的方法是什么,现在我把它按原样放在 i18n 上并在 ruby 带有变量和 html_safe 的代码,但我不知道这是否意味着任何安全隐患,我还考虑过将 html 标记作为这些 i18n 变量的参数传递

<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>

您可能希望对整个内容使用本地化片段 (Rails Guides: Localized views):

西班牙语版本在自己的文件中

# marketing.es.erb
<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>

然后是英语

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

并自动包含正确的部分

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