angular-i18next icon indicating copy to clipboard operation
angular-i18next copied to clipboard

reloadResources is not triggering newly added resources with addResourcesBundle

Open sriram275 opened this issue 5 months ago • 1 comments

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.

sriram275 avatar Sep 12 '24 18:09 sriram275