core
core copied to clipboard
Latency when loading the website, because Translation Key appears when user opens our website
Current behavior
There is latency happened when user open our website which Translation Key appears, but in localhost it woks great without latency so I do not know is the problem with server caching. After 8-15 seconds it disappear and works great and correct.
Expected behavior
The website should be opened for user without latency and without appearing Translation Key as the image below and this problem appears with all networks, devices, and browsers
How do you think that we should fix this?
Minimal reproduction of the problem with instructions
Environment
ngx-translate version: 14.0.0
Angular version: 15.2.0"
Versions:
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
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:
Take a look at your network traffic in the browser - you should see then the translation file is loaded.
An option to prevent this from happening is by pre-loading one of the languages:
https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-angular-app-with-ngx-translate#ngx-translate-glitches
If you only have a low number of languages, you might also bundle them all directly in your app instead of using the http loader.