Localization issue with 3+ languages

4 posts, 0 answers
  1. Ezequiel
    Ezequiel avatar
    36 posts
    Member since:
    Oct 2011

    Posted 15 Sep 2014 Link to this post

    Our system is multi-language, but localization for grids was only working to English.Then, we added Kendo.Mvc.resources.dll to our projects, but then, grids buttons/messages/etc are only in English and this other language.

    How can make it work to more languages?

    we have this configured:
    <% var culture = System.Threading.Thread.CurrentThread.CurrentCulture.ToString(); %>
    <script src="<%= this.ResolveUrl("~/Scripts/kendo/2014.2.903/cultures/kendo.culture." + culture + ".min.js") %>" type="text/javascript"></script>
    <script type="text/javascript">
        kendo.culture("<%= culture %>");
    </script>


    Thanks
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 17 Sep 2014 Link to this post

    Hi Ezequiel,

    I would suggest to include all resource files needed for the cultures that your project is using and:
    • If there is no localization file for given culture you can create custom one (more info here).
    • If given culture resource file is not complete (there are messages that are not translated from English) you can edit it and add the missing translations (more info here)
    Also for example of how you can dynamically change the server culture you can check the "Grid: Globalization" demo which is part of the offline examples that comes with your Telerik UI for ASP.NET MVC installation:
    Regards,
    Vladimir Iliev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Ezequiel
    Ezequiel avatar
    36 posts
    Member since:
    Oct 2011

    Posted 17 Sep 2014 in reply to Vladimir Iliev Link to this post

    in our header we have this, as stated before:
    <% var culture = System.Threading.Thread.CurrentThread.CurrentCulture.ToString(); %>
     
    <script src="<%= this.ResolveUrl("~/Scripts/kendo/2014.2.903/cultures/kendo.culture." + culture + ".min.js") %>" type="text/javascript"></script>
        <script type="text/javascript">
        kendo.culture("<%= culture %>");
    </script>
    below is the source generated:
    <script src="/TestServer/Scripts/kendo/2014.2.716/cultures/kendo.culture.pt-BR.min.js" type="text/javascript"></script>
     
    <script type="text/javascript">
        kendo.culture("pt-BR");
    </script>
    and attached is a print screen of generated Kendo Grid...

    attached also I uploaded the solution screenshot, showing the file added in our solution...
  5. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 18 Sep 2014 Link to this post

    Hi Ezequiel,

    It seems that there is some misunderstanding about what the "kendo.culture.pt-BR.min.js" script contains - these scripts contains only the date and numeric formats for the culture. The localizations of the widgets on other hand are contained in the satellite assemblies ("Kendo.Mvc.resources.dll") and if given satellite assembly is not found during compilation of the project (or is different version than the Kendo.Mvc.dll), the widgets will be loaded using their default English messages. That why I would suggest to carefully go trough the linked help articles from my previous reply and make sure the project is correctly configured.
    For convenience I also created small example which works as expected on our side with multiple cultures (including "pt-BR") and attached it to the current thread.

    Regards,
    Vladimir Iliev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready