Use ngx-translate in Angular multimodule installation and child libraries

I am using ngx-translate to translate in my Angular application. It works great with simple project setup, but we are developing a large-scale business application, and the various components are divided into several separate libraries.

Some of the libraries must have some translations, and, of course, the translation should change for all parts of the application with one click on the same button.

Using angular-librarian to link component libraries that have not yet been successful, simply create one instance ngx-translatefor both the Angular-Cli top-level project and the included Angular-librarian libraries.

I tried several installation projects, using in principle all kinds of import combinations ngx-translatewith forRoot()and / or forChild()without success. I always had a missing provider, the text appeared, but the languages ​​did not change together or in general, etc. Page

Has anyone pulled this and can show a working installation example of / plunkr?

+4
source share

Source: https://habr.com/ru/post/1684815/


All Articles