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?
@Input
s into the components of the library that need translated strings. Nothing special, I just avoided handling translations in my library at all. – Kerwon