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

Differences in Kendo Globalization (culture) and Localization (messages) files

4 Answers 453 Views
Globalization
This is a migrated thread and some comments may be shown as answers.
Kaan
Top achievements
Rank 1
Kaan asked on 07 Dec 2016, 02:39 PM

Hi!

In my web application I want to auto-detect which formats (number, date) and language to use.

This is what Chrome, Firefox and IE/Edge (default settings) send to the server:

Chrome:  Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Firefox: Accept-Language: de,en-US;q=0.7,en;q=0.3
IE/Edge: Accept-Language: de-AT

If the browser sends language information in the form of "xx-XX" (e.g. de-AT, de-DE, en-US), then it's easy to implement because there is a "kendo.culture.xx-XX.min.js" AND a "kendo.messages.xx-XX.min.js" file, and I have defined a default fallback (e.g. en-US) if "xx-XX" is not yet supported by Kendo.

However, if I only get "xx" (e.g. de, en) from the browser, then there is a "kendo.culture.xx.min.js" BUT NO "kendo.messages.xx.min.js" file, and I don't know how to handle these cases without introducing some kind of lookup table (e.g. to use de-DE, when Browser only says de).

Is there a reason, why there are no general de, en etc. messages files? What would be best practice to implement automatic browser format/language detection?

Best regards,

Kaan

4 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 09 Dec 2016, 01:19 PM
Hello Kaan,

I can suggest two approaches in this scenario to correctly map the messages scripts.

1) Manually create a value-key list to map the correct messages files.

2) Rename the kendo.messages.de-DE.js message file to just kendo.messages.de.js and used it as a default if the response from the server is only de instead of de-DE.

I will forward this to the relevant team responsible for the culture and messages scripts for additional information and I will add it in the response if needed.

Regards,
Stefan
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
0
Kaan
Top achievements
Rank 1
answered on 12 Dec 2016, 12:55 PM

Hi Stefan,

Thank you for your help. Looking forward to hear some recommendations from you and your team on how to handle automatic localization/inclusion of Kendo UI messages scripts, without having to maintain a value-key list mapping manually.

Best regards,

Kaan

0
Stefan
Telerik team
answered on 14 Dec 2016, 09:49 AM
Hello Kaan,

After consulting with the developers' team, I can confirm that there is no automatic way to map the messages script. 

Both suggested approaches in the previous reply can be used. The second one is indeed requiring a lot less manual work to be achieved.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Kaan
Top achievements
Rank 1
answered on 14 Dec 2016, 02:35 PM
Thank you, Stefan!
Tags
Globalization
Asked by
Kaan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Kaan
Top achievements
Rank 1
Share this question
or