【发布时间】:2021-04-12 07:38:45
【问题描述】:
我正在尝试将翻译添加到斯巴达克斯。我设法更改配置并在我的本地进行常规翻译 JSON,但是当我尝试向我的 HTML 添加新翻译时,我总是遇到同样的问题:
“错误错误:找不到管道'cxTranslate'!”
这是我的代码中的内容:
<label for="sortDocType">Type of document: {{ 'common.back' | cxTranslate }}</label>
还有我的配置模块:
import { ConfigModule, I18nConfig } from '@spartacus/core';
import { NgModule } from '@angular/core';
import { translationChunksConfig } from '@spartacus/assets';
@NgModule({
declarations: [],
imports: [
ConfigModule.withConfig({
i18n: {
backend: {
loadPath: '../../assets/i18n-assets/{{lng}}/{{ns}}.json'
},
chunks: {
...translationChunksConfig,
},
fallbackLang: 'en'
},
} as I18nConfig)
],
})
【问题讨论】:
标签: internationalization translation spartacus-storefront