angular-i18next
angular-i18next copied to clipboard
reloadResources is not triggering newly added resources with addResourcesBundle
Hi @Romanchuk , I am making API call in constructor to get new Resources for feature module. And adding those resources using addResourceBundle. While API call in progress or addResourceBundle in progress template already initialized and displayed with out translations.
After addResourceBundle how to re trigger to effect all new resources? I tried like below -
constructor(...) {
this.http.get(jsonURL).subscribe(resources => {
this.i18NextService.addResourceBundle(language, defaultNs, resources, true, false)
this.i18NextService.events.loaded.subscribe(() => { //I tried added but no event coming
console.log('---> All resources loaded')
this.i18NextService.reloadResources([language], [defaultNs])
})
})
}
But no luck. How to re trigger this? is there any other way?
Thanks in advance.