Angular i18n依赖问题

时间:2019-06-19 02:04:31

标签: angular internationalization

我正在尝试将i18n添加到我的角度应用程序中。从角度cli运行提取和合并过程时,出现以下错误:

> ng xi18n myapp --i18n-format xlf --output-path src/i18n --i18n-locale en && ng run credit:xliffmerge

Cannot find module '@ngx-i18nsupport/ngx-i18nsupport-lib'                    
Error: Cannot find module '@ngx-i18nsupport/ngx-i18nsupport-lib'

我的package.json具有以下开发依赖项:

"devDependencies": {
    ...
    "@ngx-i18nsupport/ngx-i18nsupport": "^1.1.5",
    "@ngx-i18nsupport/ngx-i18nsupport-lib": "^1.12.0",
    "@ngx-i18nsupport/tooling": "^8.0.2",
    ...
}

我也尝试过在全球范围内安装i18n库,但是没有运气。

2 个答案:

答案 0 :(得分:0)

找到了解决方案。我停止使用angular cli运行xliffmerge。相反,我将package.json中的extract-i118n目标更改为:

ng xi18n myapp --i18n-format xlf --output-path i18n --i18n-locale en 
&& xliffmerge --profile xliffmerge.json en fr

因此,不是直接使用angular cli运行xliffmerge,而是直接运行它。我还向项目添加了xliffmerge json配置文件。

答案 1 :(得分:0)

xliffmerge.json包含什么?

相关问题