Localization problems

5 posts, 1 answers
  1. Nassouh Chehayeb
    Nassouh Chehayeb avatar
    9 posts
    Member since:
    Apr 2010

    Posted 20 Jun Link to this post

    Hello.

    I'm currently working on a Spanish application.  The project uses the localization javascript files as described here:

    http://docs.telerik.com/kendo-ui/aspnet-mvc/globalization

    This is my code:

        <script src="~/Scripts/jquery-2.2.2.min.js"></script>
        <script src="~/Scripts/kendo/2016.2.607/kendo.all.min.js"></script>
        <script src="~/Scripts/kendo/2016.2.607/kendo.core.min.js"></script>
        <script src="~/Scripts/kendo/cultures/kendo.culture.es-ES.min.js"></script>
        <script src="~/Scripts/kendo/messages/kendo.messages.es-ES.min.js"></script>
        <script> kendo.culture("es-ES");</script>

    The problem is that 'kendo.messages.es-ES.min.js' is ignored. There are some text that are not translated. Checking every thing we found out that the translations were taken from the 'Kendo.Mvc.resources.dll' in the 'bin/es-ES' folder. This 'dll' has some texts translated and orders not as you can see in the attached image. You can noticed that in the 'kendo.messages.es-ES.min.js' the texts are translated, but in the resulting grid there's not the case.

    After that I figured out that if I delete the file 'Kendo.Mvc.resources.dll' in 'bin/es-ES' while running the application in the localhost the texts are translated using the translations of the 'kendo.messages.es-ES.min.js'. So I suppose that the 'kendo.messages.es-ES.min.js' overwrites the default English messages but the 'Kendo.Mvc.resources.dll' in 'bin/es-ES overwrites 'kendo.messages.es-ES.min.js' no matter where I call this javascript.

    So, how can I change this behavior giving preference to the 'kendo.messages.es-ES.min.js' javascript? Or is any way to edit the Spanish 'Kendo.Mvc.resources.dll' and add the missing messages?

  2. Nassouh Chehayeb
    Nassouh Chehayeb avatar
    9 posts
    Member since:
    Apr 2010

    Posted 20 Jun Link to this post

    I put something wrong and there's no edit option.

    The third script is not <script src="~/Scripts/kendo/2016.2.607/kendo.core.min.js"></script> is <script src="~/Scripts/kendo/2016.2.607/kendo.aspnetmvc.min.js"></script>

    Sorry for the mistake.

  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 22 Jun Link to this post

    Hi Nassouh,

    The MVC Kendo wrappers localization differs from the standard Kendo JavaScript localization.

    As you correctly noticed the MVC wrapper uses Kendo.Mvc.resources.dll. The difference comes from the fact that the MVC Grid wrapper renders not only JavaScript configuration but also some HTML content. For example the pager messages are rendered directly in the markup by the server wrapper.

    The kendo.messages.es-ES.min.js file changes the messages configuration in the widget's prototype which will work for all strings that are *not* directly rendered in the HTML by the server wrapper.

    I am afraid that there is no way to change what the MVC server wrappers renders. You may only create a custom MVC resource file that will translate the message rendered on the server.


    Regards,
    Alexander Valchev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Nassouh Chehayeb
    Nassouh Chehayeb avatar
    9 posts
    Member since:
    Apr 2010

    Posted 27 Jun Link to this post

    Hi Alexander,

    Finally I opted to create a custom MVC resource file. It was difficult to find the '\src\Kendo.Mvc\Kendo.Mvc.csproj' but finally I figured out by opening the README file. I suggest updating the guides for further cases about the localization of the 'Kendo.Mvc.csproj' project . 

    Thank you for the explanation.

  6. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 29 Jun Link to this post

    Hi Nassouh,

    Thank you for the suggestion. We will review the help topic.

    Regards,
    Alexander Valchev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready