ed-*_*ter 5 javascript data-binding internationalization angular
当我尝试使用i18n将英语翻译成法语时,在按照https://angular.io/docs/ts/latest/cookbook/i18n.html逐字逐句进行国际化教程时,一切都很有效.
但是,当我尝试使用Angular 2的数据绑定将变量文本插入到HTML中时,它就会停止工作.
这是我的HTML:
<h1 i18n="User welcome|An introduction header for this sample">{{value}}</h1>
这是我的组件:
import { Component } from '@angular/core';
@Component({
moduleId: module.id,
selector: 'my-app',
templateUrl: 'app.component.html'
})
export class AppComponent {
public value = "Hello i18n!";
}
Run Code Online (Sandbox Code Playgroud)
这是我的XLF文件:
<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="ng2.template">
<body>
<trans-unit id="af2ccf4b5dba59616e92cf1531505af02da8f6d2" datatype="html">
<source>Hello i18n!</source>
<target>Bonjour i18n!</target>
<note priority="1" from="description">An introduction header for this sample</note>
<note priority="1" from="meaning">User welcome</note>
</trans-unit>
</body>
</file>
</xliff>
Run Code Online (Sandbox Code Playgroud)
这是错误:
zone.js@0.6.25:357错误:未捕获(在承诺中):错误:模板解析错误:消息不可用于消息id ="95184d0fe43359bff724d20df3a1317aef86799c"("[错误 - >] {{值}}
| 归档时间: |
|
| 查看次数: |
2360 次 |
| 最近记录: |