Kendo does not load some culture messages

I am trying to localize Kendo for my application. My language was not initially supported, so I added a localized version inmessages/kendo.messages.xx-XX.min.js

  1. I added this line to mine web.config: <globalization uiCulture="xx-XX" culture="xx-XX"></globalization>

  2. And I included these scripts in the kendo script:

<script src="~/Scripts/kendo/2014.3.1314/kendo.culture.xx-XX.min.js"></script> <script src="~/Scripts/kendo/2014.3.1314/messages/kendo.messages.xx-XX.min.js"></script>

Kendo still shows some English messages for my kind of grid. If I change the value uiCultureto en-US, it will not download the English file and show my edited version. But any value other than en-USworks fine, and Kendo uses its localized messages. And yes, I'm sure I didn't accidentally edit the file en-US... Any suggestion?

+4
source share
2 answers

I am really distracted. I have to answer this question for those who have a similar problem. As noted in the Kendo documentation, the .js files have nothing to do with the MVC application. You should:

  • Open the Kendo.Mvc.slnsolution.
  • In the folder, Resourcescopy the file Messages.resxand rename it with the culture code, for example Messages.en-US.
  • Recover the solution as Release.
  • Copy the Kendo.Mvc.dllfile and folder with the culture code from the folder bin/releaseto lib/KENDOUIMVC/{Date}your project folder .
  • Set uiCulturethe tag value Globalizationin your file web.configand you are ready to go!
+3
source

See Overview of Kendo Globalization .

_Layout.cshtml:

@{
    var culture = System.Threading.Thread.CurrentThread.CurrentCulture.ToString();
}
<script src="@Url.Content("~/Scripts/kendo/2014.3.1314/kendo.culture." + culture + ".min.js")"></script>    
<script type="text/javascript">
    kendo.culture("@culture");
</script>

:

Kendo culture

+2

Source: https://habr.com/ru/post/1584728/


All Articles