Fixes issues around missing translation strings when using ionic-manup internal translations.
Due to a misunderstanding of how ngx-translate actually works, ionic-manup could have had a couple of issues:
Missing translation strings when presenting ManUp alerts - especially if language changed
Missing translation strings in other parts of the app if ManUp's translation strings were loaded before the rest of the app's translations
This was because of incorrect assumptions about ngx-translate: If there are any translation strings loaded into TranslateService for a given language, then the service doesn't attempt to load external strings later, even if it does not have a requested string. This is because ngx-translate assumes that any language strings loaded by translateService.setTranslation or loaded by a loader are complete - ie they have all the translations necessary for the app.
This PR modifies the behaviour of ManUpService so that its translation strings are loaded just before alerts are shown, instead of in the constructor. This ensures that ManUp's translation strings do not replace the app's translation strings, and that ManUp's strings will be there when the alert needs to be shown.
Coverage decreased (-0.09%) to 77.686% when pulling 8bca524a2750f1f98a81987a41dc416e0b87de8a on feature/31-missing-translations into 355fc7d9acbcc7dc35563e84fc0baa773d4b7cbb on master.
Fixes issues around missing translation strings when using ionic-manup internal translations.
Due to a misunderstanding of how ngx-translate actually works, ionic-manup could have had a couple of issues:
This was because of incorrect assumptions about ngx-translate: If there are any translation strings loaded into TranslateService for a given language, then the service doesn't attempt to load external strings later, even if it does not have a requested string. This is because ngx-translate assumes that any language strings loaded by
translateService.setTranslation
or loaded by a loader are complete - ie they have all the translations necessary for the app.This PR modifies the behaviour of ManUpService so that its translation strings are loaded just before alerts are shown, instead of in the constructor. This ensures that ManUp's translation strings do not replace the app's translation strings, and that ManUp's strings will be there when the alert needs to be shown.
Closes #31