我想知道是否可以翻译页面中有HTML标记的部分内容。
示例:
<p i18n="@@genericError">
Please Try again or <a href="https://help.companyx.com">get in touch</a> with us for help.
</p>我的翻译文件如下所示:
<trans-unit id="genericError" datatype="html">
<source>
Please Try again or <x id="START_LINK" ctype="x-a" equiv-text="<a>" />get in touch<x id="CLOSE_LINK" ctype="x-a" equiv-text="</a>" /> with us for help.
</source>
<target>
Por favor tente novamente ou <x id="START_LINK" ctype="x-a" equiv-text="<a>" />entre em contato<x id="CLOSE_LINK" ctype="x-a" equiv-text="</a>" /> conosco.
</target>
</trans-unit>当我尝试使用ng服务运行我的项目时,我会得到以下错误:
未知占位符START_LINK中的错误
我检查了online (https://github.com/angular/angular/issues/25242),如果我正确理解的话,似乎HTML并不打算嵌入到翻译文件中。
你们有什么解决办法吗?
谢谢你!
发布于 2018-12-21 02:26:19
是的。您必须将每个文本节点与围绕a标记的任何其他标记分开。
https://stackoverflow.com/questions/53878424
复制相似问题