Yog*_*tel 3 angular-i18n angular
在我的 Angular 7 应用程序中,我有一个带有嵌套标签的 html,如下所示 -
<p i18n="@@footerText">Some Text Here
<a i18n="@@footerLink" href="http://url.com" target="_blank">Link Text</a>
Another Text Here
</P>
Run Code Online (Sandbox Code Playgroud)
当执行以下命令时
ng xi18n --output-path translate
Run Code Online (Sandbox Code Playgroud)
它引发错误 -
错误:无法将元素标记为可翻译部分中的可翻译
如何将 i18n 与嵌套标签一起使用?
<p>
<ng-container i18n="@@footerPrefix">Some Text Here</ng-container>
<a i18n="@@footerLink" href="http://url.com" target="_blank">Link Text</a>
<ng-container i18n="@@footerSuffix">Another Text Here</ng-container>
</p>
Run Code Online (Sandbox Code Playgroud)
或者只是将所有内容(包括链接)放入翻译中
<p i18n="@@footerText">Some Text Here
<a href="http://url.com" target="_blank">Link Text</a>
Another Text Here
</p>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2861 次 |
| 最近记录: |