I'm submitting a ... (check one with "x")
[ x ] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request
Current behavior
When switch to a different language. an empty translation object returned:
lang changed detected {lang: "dutch", translations: {}}
Expected/desired behavior
Should load the new language file
Reproduction of the problem
If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar.
it's a ionic 3 project. Please install ionic 3 if you haven't.
git clone https://github.com/lolaswift/lazyTrans
cd lazyTrans
npm install
ionic serve
When click on "Nederlands", "Good Morning" is not translated.
What is the expected behavior?
You should see the Dutch translation of "Good Morning", which is
"Goedemorgen!"
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
"@ngx-translate/core": "^8.0.0",
"@ngx-translate/http-loader": "^2.0.0",
"ionic-angular": "3.9.2",
"@angular/core": "5.0.1",
Update: by loading the translate loader on every page seems to have solved my issue
But it shouldn't be necessary, is it?
https://forum.ionicframework.com/t/ngx-translate-is-broken-when-used-with-ionic-lazy-loading/112624
Can you please clarify what should be the right way of fixing the issue.
As explained here https://forum.ionicframework.com/t/ngx-translate-is-broken-when-used-with-ionic-lazy-loading/112624/11 this worked for me. The loader is only required on pages that can set the language
Most helpful comment
As explained here https://forum.ionicframework.com/t/ngx-translate-is-broken-when-used-with-ionic-lazy-loading/112624/11 this worked for me. The loader is only required on pages that can set the language