This is a migrated thread and some comments may be shown as answers.

Localization "items per page" - custom project vs. template project

1 Answer 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Iron
Iron
Iron
Stefan asked on 24 Sep 2020, 07:05 AM

We have a problem that after implementing the localization as described in article https://docs.telerik.com/aspnet-mvc/globalization/overview the text "items per page" is only localized after hitting F5 once. Initially it is always displayed in English.

I then created a vanilla Telerik MVC project incl. the grid, from the the default Telerik templates. When I activate paging there, the text is automatically correctly localized.

What I am wondering about ist, that I don't see any localized JS files in that project. Can you tell me how your template project applies the localization? It seems to differ from the mentioned article in this regard.

 

Regards

Kai

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 25 Sep 2020, 01:26 PM

Hello, Stefan,

The Kendo UI Grid for ASP.NET MVC uses Resources to localize the pager display messages:

https://docs.telerik.com/aspnet-mvc/globalization/localization

This is how the portion for the pager looks like in the source:

// example from the French resource file
~/Kendo.Mvc/Resources/Messages.fr-FR.resx

<data name="Pager_Display" xml:space="preserve">
    <value>Afficher les items {0} - {1} de {2}</value>
 </data>

During serialization, the messages are provided in the generated script file as part of the grid definition:

If you wish to check the messages, you can copy and paste the script in some JavaScript beautifier and see what you have in the grid:

I hope this helps.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
Grid
Asked by
Stefan
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or