【问题标题】:How to implement ng xi18n on array of objects如何在对象数组上实现 ng xi18n
【发布时间】:2017-05-24 17:39:42
【问题描述】:

我正在尝试使用 ng xi18n angular 2 方式构建本地化。因为它从模板(即 html 文件)中捕获文本。在我的情况下,我正在使用 *ngFor 在 html 页面中呈现数据,这从不同的文件中占用了一个数组.那么我将如何实现它,因为我无法直接翻译messages.xlf文件中的文本,因为该文本来自对象数组,因此会不断变化。

【问题讨论】:

    标签: arrays angular localization internationalization interpolation


    【解决方案1】:

    据我所知,这是当前 i18n 实现的限制。 其他人已请求支持在 HTML 模板之外使用翻译。

    在此处查看此请求: https://github.com/angular/angular/issues/11405

    你也可以看到我自己的类似问题的答案:

    How to use i18t for texts in the source code of Angular project?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-05
      • 1970-01-01
      相关资源
      最近更新 更多