Use ngx-translate in a multi-module Angular setup and child-libraries

拈花ヽ惹草 提交于 2019-12-21 04:39:16

问题


I am using ngx-translate for translation in my Angular app. It works just fine with a simple project setup, but we develop a large-scale business application and different components are split into several seperate libraries.

Some of the libraries do need to have some translations and of course translation should change for all parts of the app with a click on the same button.

Using angular-librarian for bundling the component libraries I have so far not been succesful to just create one instance of ngx-translate for both the top-level Angular-Cli project and the included angular-librarian libraries.

I have tried several project-setups using basically all sorts of combinations of importing ngx-translate with forRoot() and / or forChild() without success. I always had either a missing provider, text showed up but languages did not change together or at all etc. pp.

Has anyone pulled this of and can show a working project-setup example / plunkr?

来源:https://stackoverflow.com/questions/45980408/use-ngx-translate-in-a-multi-module-angular-setup-and-child-libraries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!