Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Waiting for the translations being loaded before translating #59

Closed
millerf opened this issue Oct 3, 2018 · 2 comments
Closed

Waiting for the translations being loaded before translating #59

millerf opened this issue Oct 3, 2018 · 2 comments

Comments

@millerf
Copy link

millerf commented Oct 3, 2018

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!

@rokulis
Copy link

rokulis commented Oct 24, 2018

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

@millerf
Copy link
Author

millerf commented Oct 25, 2018

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...

@millerf millerf closed this as completed Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants