ngx-translate/http-loader

Waiting for the translations being loaded before translating

millerf opened this issue · 2 comments

Hi,

I am using a CustomLoader over http to get my translations (Angular 5).

Unfortunately, I am requesting some translations in a service at app launch, so the translations are done straight away, before the files are loaded.

Is there a way to tell the Translater to wait for the HttpLoader to be done before doing the translations?

I tried to look around on stackoverflow without success...

Thanks!

I have encountered with same problem. @millerf, did you find the solution?

Yes, @taskiukas
You can find it here on issue #517:
ngx-translate/core#517 (comment)

Use the AppInitializer. In my case I prefered to have a "loader" on the AppComponent until the translate.use() is finished, in order not to have the feeling the app is stuck on a white screen...