We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Globalization and Localization do not work

protected override void OnAfterRender()
    {
   this.JsRuntime.Ejs().LoadLocaleData("wwwroot/ej2-locale/src/de.json").SetCulture("de").LoadCldrData(new string[] { "wwwroot/cldr-data/main/de/currencies.json", "wwwroot/cldr-data/main/de/numbers.json" });          
    }

4 Replies

RS Renjith Singh Rajendran Syncfusion Team August 5, 2019 11:57 AM UTC

Hi Ebi, 

Thanks for contacting Syncfusion support. 

We have checked the shared code snippet with us and found that you have missed to load the following highlighted CLDR data files while using “LoadCldrData” function for cultures other than “en-US”. 

File Name 
Path 
ca-gregorian 
cldr/main/en/ca-gregorian.json 
timeZoneNames 
cldr/main/en/timeZoneNames.json 
numbers 
cldr/main/en/numbers.json 
numberingSystems 
cldr/supplemental/numberingSystems.json 
currencies 
cldr/main/en/currencies.json 

Please refer the below code snippet 

 
    protected override void OnAfterRender() 
    { 
       this.JsRuntime.Ejs().LoadLocaleData("wwwroot/de.json").LoadCldrData(new string[] { "wwwroot/scripts/cldr-data/main/de/currencies.json", "wwwroot/scripts/cldr-data/main/de/numbers.json", "wwwroot/scripts/cldr-data/main/de/ca-gregorian.json", "wwwroot/scripts/cldr-data/main/de/timeZoneNames.json""wwwroot/scripts/cldr-data/supplemental/numberingSystems.json" }).SetCulture("de"); 
    } 
 
 
For your convenience we have created the sample and the same can be downloaded from the below link 

 
Currently, we are documenting this topic in our Blazor UG documentation by explaining the above provided suggestion. We will complete this documentation and this will be refreshed online. 
 
If you are still facing difficulties in achieving your requirement, please get back to us with the following details, 

  1. Share the full Grid code.
  2. Share with us the detailed explanation of the problem you are facing.
  3. Type of sample.
  4. Version details.
  5. If possible, reproduce the problem in the above attached sample and share with us.

The provided information will help us analyze the problem, and provide you a solution as early as possible. 

Regards, 
Renjith Singh Rajendran. 



ET ebi torabi August 7, 2019 03:47 PM UTC

Hi Renjith Singh Rajendran.
If possible, give an example in the hosted core.
SetCulture("fa")
protected override void OnAfterRender() 
    { 
       this.JsRuntime.Ejs().LoadLocaleData("wwwroot/fa.json").LoadCldrData(new string[] { "wwwroot/scripts/cldr-data/main/fa/currencies.json""wwwroot/scripts/cldr-data/main/fa/numbers.json""wwwroot/scripts/cldr-data/main/fa/ca-gregorian.json""wwwroot/scripts/cldr-data/main/fa/timeZoneNames.json",  "wwwroot/scripts/cldr-data/supplemental/numberingSystems.json" }).SetCulture("fa"); 
    } 



RS Renjith Singh Rajendran Syncfusion Team August 8, 2019 11:12 AM UTC

Hi Ebi, 
  
Based on your request, we tried to create a blazor hosted core(Client Blazor application). But we face issue when try to load the culture files with a Client Blazor application. So we have confirmed this as an issue and logged a defect report for the same. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our subsequent Nuget release which is expected to be roll out on or before August 19th 2019.  
  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.  
  
Once the fix is rolled out, we will provide the requested sample in Client blazor application. Until then we suggest you to use the server blazor application.  
  
We have uploaded the locale culture files in the below GitHub link. Please refer the link below for the “fa.json” file, 
  
And the CLDR data files for the corresponding culture files is available as npm package. So, you can install it through the below command to our package. 
  
  
npm install cldr-data 
  
  
Please get back to us if you need further assistance. 
  
Regards, 
Renjith Singh Rajendran. 



RS Renjith Singh Rajendran Syncfusion Team September 20, 2019 12:18 PM UTC

Hi Ebi, 

Thanks for your patience. 

We have prepared a Client Side Blazor Globalization sample in our latest version(17.2.52) Nuget package, in which we have migrated to .Net Core 3.0 RC1. Please download the sample from the link below, 
 
Please use the code below, 

 
    protected override async Task OnInitializedAsync() 
    { 
        var data = await Http.GetJsonAsync<object>("localefiles/de.json"); 
        var sup1 = await Http.GetJsonAsync<object>("localefiles/cldr-data/supplemental/numberingSystems.json"); 
        var sup2 = await Http.GetJsonAsync<object>("localefiles/cldr-data/main/de/ca-gregorian.json"); 
        var sup3 = await Http.GetJsonAsync<object>("localefiles/cldr-data/main/de/numbers.json"); 
        var sup4 = await Http.GetJsonAsync<object>("localefiles/cldr-data/main/de/timeZoneNames.json"); 
        var sup5 = await Http.GetJsonAsync<object>("localefiles/cldr-data/main/de/currencies.json"); 
 
        var cldrData = new object[] { sup1, sup2, sup3, sup4 ,sup5}; 
 
        this.JsRuntime.Ejs().LoadLocaleData(data).LoadCldrData(cldrData).SetCulture("de").SetCurrencyCode("EUR"); 
    } 


Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 


Loader.
Live Chat Icon For mobile
Up arrow icon