【问题标题】:How to use HTML markups in .po translation files using <Trans id="xxx"/> (@lingui/react)如何使用 <Trans id="xxx"/> (@lingui/react) 在 .po 翻译文件中使用 HTML 标记
【发布时间】:2020-07-03 01:16:52
【问题描述】:

在我的 React 代码中:

<Trans id={"hello"} />

在 .po 文件中我有:

msgid "hello"
msgstr "Hello <strong> world! </strong>"

但翻译不适用于&lt;strong&gt;。有没有办法让这个文本加粗?

谢谢

【问题讨论】:

    标签: html reactjs po


    【解决方案1】:

    我找到了解决办法:

    <Trans id={"hello"}>
    <strong>world!</strong>
    </Trans>
    
    msgid "hello"
    msgstr "Hello <0> world! </0>"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-13
      • 2017-11-02
      • 1970-01-01
      相关资源
      最近更新 更多