有没有办法在多个语言环境中使用 i18nSelect?

时间:2021-05-08 11:19:10

标签: html angular dynamic internationalization translation

我正在使用 Angular i18n 和 i18nSelect 管道翻译 Kendo 网格中的列标题。目前,初始(英语)翻译有效,但我找不到添加其他语言环境的方法。我的代码如下所示。

  <kendo-grid-column
    *ngFor="let column of overviewGridService.overviewGridColumns.columns"
    [field]="column.field"
    i18n-title title= "{{column.field | i18nSelect : getMap() }}"
    [width]="column.width"
  ></kendo-grid-column>

而messages.nl.xlf中的代码如下:

  <trans-unit id="187187500641108332" datatype="html">
    <source><x id="INTERPOLATION" equiv-text="{{column.field | i18nSelect : getMap()}}"/></source>
    <target><x id="INTERPOLATION" equiv-text="{{column.field | i18nSelect : getMap2()}}"/></target>
    <context-group purpose="location">
      <context context-type="sourcefile">src/app/components/overview/overview.component.html</context>
      <context context-type="linenumber">17</context>
    </context-group>
  </trans-unit>

在 中,getMap2() 最终应该具有标题的荷兰语翻译。 有什么办法可以使这项工作正常进行,还是应该包含另一个库?

0 个答案:

没有答案
相关问题