2017-05-17 28 views
0

在我的開發者機器上我有波蘭語系統,但我需要用英語開發所有頁面。我正在使用示例Telerik C#ASP.NET核心MVC應用程序。Kendo ASP.NET核心語言

我的剃刀代碼目前:

<p>CurrentCulture: @Html.Raw(System.Globalization.CultureInfo.CurrentCulture.ToString())</p> 
<p>CurrentUICulture: @Html.Raw(System.Globalization.CultureInfo.CurrentUICulture.ToString())</p> 
@(Html.Kendo().Grid<TelerikAspNetCoreApp2.Models.OrderViewModel>() 
    .Name("grid") 
    .Columns(columns => 
    { 
     columns.Bound(p => p.OrderID).Filterable(false); 
    }) 
    .Groupable() 
    .DataSource(dataSource => dataSource 
     .Ajax() 
     .PageSize(20) 
     .Read(read => read.Action("Orders_Read", "Grid")) 
    ) 
) 

HTML結果是:

<p>CurrentCulture: en-US</p> 
<p>CurrentUICulture: en-US</p> 
<div id="grid" name="grid"></div><script>kendo.syncReady(function(){jQuery("#grid").kendoGrid({"groupable":{"enabled":true,"messages":{ 
"empty":"Przeciągnij nagłówek kolumny i upuść go tutaj aby pogrupować według tej kolumny"}},"columns":[{"title":"Order ID","field":"OrderID","filterable":false,"encoded":true},{"title":"Freight","field":"Freight","filterable":{"messages":{"info":"Pokaż wiersze o wartościach które","isTrue":"prawda","isFalse":"fałsz","filter":"Filtr","clear":"Wyczyść filtr","and":"Oraz","or":"lub","selectValue":"-Wybierz wartość-","value":"Wartość","cancel":"Anuluj","selectedItemsFormat":"{0} selected items"} .... 

HTML渲染代碼包含有效的文化信息= EN-US,但劍道網消息在波蘭語言。如何強制劍道使用英語?是否也可以禁用此消息?我想要有簡短的JavaScript,因爲它是純Kendo JS。

回答

0

一定要設置你的文化客戶端,並確保你的應用程序支持的語言文化支持文件部署。

kendo.culture("en-US"); 

kendo.culture("pl-PL");