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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Client-side localization and OnAfterRender

Thread ID:

Created:

Updated:

Platform:

Replies:

146497 Aug 6,2019 10:06 AM UTC Jan 27,2020 09:34 AM UTC Blazor 12
loading
Tags: Scheduler
Riccardo Zucchetto
Asked On August 6, 2019 10:06 AM UTC

Hi,
I am not able to localize the Scheduler in client-side Blazor.
I attach an example of this issue: the program is not able to find the files, according the code used in your tutorial (which is server only). It tries to localize the Scheduler in the OnAfterRender method, but you can also try with the "Localize" button.
I have also tried to locate the files, but it seems they do not exist in the client.

There are three things:
1) the localization files are not found;
2) there is a mismatch in a file name, in your tutorial: you look for "numberingSysytems.json" file, but there is no such file in cldr-data directory; is "numbers.json" the right one?
3) when "OnAfterRender" is called, the Scheduler is not fully available. If I try to access some parts (like cells or other), the command "document.querySelectorAll('.e-time-slots');" returns an empty array; if I wait for a second, then it returns all the slots. This may affect also the localization; what is the right way to access a fully formed Scheduler in the OnAfterRender method?

Thank you,
Riccardo

Attachment: SyncfusionBlazor_Localization_2db887bf.zip

Karthigeyan Krishnamurthi [Syncfusion]
Replied On August 7, 2019 03:16 PM UTC

Hi Riccardo 
  
Syncfusion greetings. 
 
We could reproduce the reported locale issue with Client Blazor application. We are validating with high priority and will provide the further details with timeline for the fix on August 8, 2019. 
 
Regards, 
Karthi 


Riccardo Zucchetto
Replied On August 8, 2019 09:11 AM UTC

Hi Karthigeyan,
Thank you for your answer.
I will wait for your updates.

Thank you,
Riccardo

Karthigeyan Krishnamurthi [Syncfusion]
Replied On August 8, 2019 10:38 AM UTC

Hi Riccardo, 
  
Thanks for the update. 
  
We have logged the below bug report for the reported case “localization not working in Client Blazor”. The fix will be included in biweekly release on August 19, 2019. 
 
Regards, 
Karthi 


Riccardo Zucchetto
Replied On August 8, 2019 12:04 PM UTC

Hi Karthigeyan,
Thank you for your update, I will wait for the fix.

As for point 3) ("OnAfterRender" called when the scheduler is not fully available yet), will the fix be included in the same release or is this behavior related to something different?

Riccardo

Karthigeyan Krishnamurthi [Syncfusion]
Replied On August 10, 2019 01:50 PM UTC

Hi Riccardo, 
Thanks for the update. 
The layout rendering for Scheduler with resource option will be in progress with in “OnAfterRender” function. So we suggest you to use “DataBound” event which will trigger once scheduler and events rendered completely.

 
Regards, 
Karthi 
 


Riccardo Zucchetto
Replied On August 12, 2019 07:16 AM UTC

Hi Karthi,
It seems to work exactly as I need.

Thank you,
Riccardo

Karthigeyan Krishnamurthi [Syncfusion]
Replied On August 13, 2019 05:06 AM UTC

Hi Riccardo,  
 
We are happy that our solution fulfilled your requirement. 
 
Please let us know for further assistance. 
 
Regards, 
Karthi 


Riccardo Zucchetto
Replied On August 27, 2019 03:21 PM UTC

Hi Karthi,
I have tried to localize the client-side scheduler, however I am not able to do it.
I attach an example: both on load and on button click, it should localize the scheduler, but the Http call for the file fails with status 404, even if the files are copied while compiling.
Can you please tell me if I missed something? Should the files be on the .server project, shouldn't they?

Thank you,
Riccardo

Attachment: SyncfusionBlazor_ClientLocalization_605f094e.rar

Nevitha Ravi [Syncfusion]
Replied On August 28, 2019 11:39 AM UTC

Hi Riccardo, 

Thanks for your update. 
 
We have checked your code in which the path for the files are wrong which is the cause for the reported problem. The files should be in .client project and for the same we have modified the sample for your reference. 

    [Inject] 
    protected IJSRuntime JsRuntime { get; set; } 
    protected override async Task OnInitializedAsync() 
    { 
        var data = await Http.GetJsonAsync<object>("ej2-locale/src/it.json"); 
        var sup1 = await Http.GetJsonAsync<object>("cldr-data/supplemental/numberingSystems.json"); 
        var sup2 = await Http.GetJsonAsync<object>("cldr-data/main/it/timeZoneNames.json"); 
        var sup3 = await Http.GetJsonAsync<object>("cldr-data/main/it/ca-gregorian.json"); 
        var sup4 = await Http.GetJsonAsync<object>("cldr-data/main/it/numbers.json"); 
        var cldrData = new object[] { sup1, sup2, sup3, sup4 }; 
        this.JSRuntime.Ejs().LoadLocaleData(data).LoadCldrData(cldrData).SetCulture("it").SetCurrencyCode("EUR"); 
    } 

Currently we are having issue with template rendering in client side localization sample, so we have removed the resource header template in the above sample. We are validating the issue at our end, so we will update further details on August 29, 2019. We would appreciate your patience until then. 

Regards, 
Nevitha. 


Riccardo Zucchetto
Replied On August 28, 2019 12:17 PM UTC

Hi Nevitha,

The sample is working and I managed to make the localization work in my project.

I will wait for your updates; however, my main problem was the "normal" localization, that now is working.

May I suggest you to correct the sample in your documentation?

https://ej2.syncfusion.com/blazor/documentation/common/globalization/?no-cache=1

Here it is stated that the client-side path is wwwroot/ej2-locale/src/de.json, while you put in the sample the following path: ej2-locale/src/de.json (without www), this is why it didn't work for me.

Thank you,

Riccardo


Nevitha Ravi [Syncfusion]
Replied On August 29, 2019 04:32 PM UTC

Hi Riccardo,
Thanks for your update and patience. 
 
We confirmed the issue “template not rendering while using localization in client side blazor application” as a defect and logged the bug report which can be tracked from the following link. 

The issue fix will be included in our bi-weekly patch release rolled out in the mid of September and would appreciate your patience until then. We have refreshed our documentation with correct path. 

Regards, 
Nevitha. 


Alagumeena Kalaiselvan [Syncfusion]
Replied On January 27, 2020 09:34 AM UTC

Hi Riccardo, 

Sorry for the delay to get back to you! 

We have resolved your reported issue “Template not rendering while using localization in client side blazor application” and  included with patch release which is promised.  

Refer to the below release notes. 

We will happy to assist you if you need further assistance. 

Regards 
Alagumeena.K

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon