Open denniske opened 6 years ago
class WebpackTranslateLoader implements TranslateLoader {
getTranslation(lang: string): Observable<any> {
return from(import(`../assets/i18n/${lang}.json`));
}
}
...
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useClass: WebpackTranslateLoader,
},
}),
Current behavior
When hmr is enabled and a translation file is changed the application is not reloaded.
Expected behavior
When a translation file is changed the application hot reloads and displays new translations.
How do you think that we should fix this?
Can this even be fixed? Do I need to use the WebpackTranslateLoader instead of TranslateHttpLoader to fix this? Is there any other way?
Minimal reproduction of the problem with instructions
Go to https://stackblitz.com/github/ngx-translate/example Change something in en.json App is not reloaded
Environment