File manager- custom localization not working

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


1 Reply

IL Indhumathy Loganathan Syncfusion Team March 17, 2022 07:35 AM UTC

Hi Rohit, 
 
Greetings from Syncfusion support. 
 
The File Manager can be localized to any culture by defining the texts and messages of the file manager in the corresponding culture. When you set the culture for FileManager, the contents of the toolbar and context menu can be altered to match the culture. We have achieved localization for File Manager by using locale and setCulture. This is working fine at our end. 
 
Please refer to the below sample for reference. 
 
 
Kindly check the above sample to achieve localization at your end. If you face any issues, please replicate the issue in the above shared sample to provide a prompt solution. 
 
Regards, 
Indhumathy L 


Loader.
Up arrow icon