-
Notifications
You must be signed in to change notification settings - Fork 69
Multiple HTTP requests #68
Comments
I'm experiencing the same issue. |
@emeryowa this is indeed not well behaviour. In fact now i'm not using http-loader due to this issue. This |
@SoapyMan I have implemented a custom loader, identical to the function you posted. I am getting the same error though = the call to the translations file is requested multiple times. Do you have any tips? |
I've encountered the same error. Fortunately, the error message with your loader @SoapyMan is much better than the one in the ngx-translate loader. My Error shows:
|
I created the following loader which does simple caching:
|
@larsvliet thank you
|
Current behavior
Currently TranslateHttpLoader produces HTTP request every time getTranslation is called.
Expected behavior
TranslateHttpLoader should store state of language file loading and only one HTTP request is made.
How do you think that we should fix this?
This is how I implemented this (proof of concept, it performs only ONE request, everything works and tokens are translated):
Minimal reproduction of the problem with instructions
Even standard ngx-translate template calls getTranslation at least two times.
My app got approximately 140 (app with multiple pages and modules) and lots of annoying alerts were displayed in case when translations were not found. If success, other requests fetched (304), but fetch still has delay.
Environment
The text was updated successfully, but these errors were encountered: