ngx-translate / core

The internationalization (i18n) library for Angular
MIT License
4.5k stars 574 forks source link

not working in nested lazy loading module #925

Open soorireddy opened 6 years ago

soorireddy commented 6 years ago

Current behavior

it is forcing to add translate.use('lang') in every component of lazy loaded module of another lazy loaded module

Expected behavior

it should work same as parent lazy loaded module

Example use case.. (Course -->Book ---> chapter --> lesson ->>page ) actors :: author , reader ,...

How do you think that we should fix this?

deep propagation should be allowed for translate service.

Minimal reproduction of the problem with instructions

Environment


ngx-translate version: X.Y.Z
Angular version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

For Tooling issues:
- Node version: XX  
- Platform:  

Others:

soorireddy commented 6 years ago

constuctor(protected translate: TranslateService, protected store: Store, protected userStore: Store) { this.store.select(state => state.userpref).subscribe(userContext => this.translate.use(userContext[0].prefLang)); }

luiscla27 commented 5 years ago

this issue is duplicated here