Hi Team,
We are using File manager control with custom localization using L10n.load and the locale property of file manager control.
We have given the complete locale object to L10n.load method from our own service which gets localized string from a pre-existing json file e.g. es_ES.json (available in our local assets/locale folder).
This works in our local environment properly. But the localization fails in case of the deployment sever. It always loads fileManager in English irrespective of any locale set in our settings.
We get the localized object at time of component initialization(can see in console) but seems that does not get applied to the File manager control.
L10n.load() and setting the locale property in ngOninit() method of the component
Below is the snippet for our implementation.
ngOnInit(){
this.subscriptions.push(
this.feManager.getCurrentLocaleData().subscribe((data) => {
if (this.userSettings) {
this.currentLanguange = this.userSettings.LOCALE.split('_')[0]; //("es" -from current locale "es_ES")
}
let localeObject = {};
localeObject[this.currentLanguange] = { filemanager: data }; //data - complete object having translation
//
related to
file manager as per format given in docs
L10n.load(localeObject);
// setCulture(this.currentLanguange);
this.locale = this.currentLanguange;
})
);
}
We tried using setCulture() as well, that also doesn't work for us .
Could you please assist on this at the earliest as the Component has to go to production till end of the month.
Thanks,
Rohit