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

5 posts, 1 answers
  1. Kaan
    Kaan avatar
    46 posts
    Member since:
    May 2016

    Posted 07 Dec 2016 Link to this post

    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

  2. Answer
    Stefan
    Admin
    Stefan avatar
    1007 posts

    Posted 09 Dec 2016 Link to this post

    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.
  3. Kaan
    Kaan avatar
    46 posts
    Member since:
    May 2016

    Posted 12 Dec 2016 in reply to Stefan Link to this post

    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

  4. Stefan
    Admin
    Stefan avatar
    1007 posts

    Posted 14 Dec 2016 Link to this post

    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 visualization (charts) and form elements.
  5. Kaan
    Kaan avatar
    46 posts
    Member since:
    May 2016

    Posted 14 Dec 2016 in reply to Stefan Link to this post

    Thank you, Stefan!
Back to Top