安裝什麼的就不用多說了,進入後台,Configuration->Languages 下添加簡體中文,資源包在官網上下載。
1. \Libraries\Nop.Core\CommonHelper.cs 中的 SetTelerikCulture 方法中,
1 public static void SetTelerikCulture() 2 { 3 //little hack here 4 //always set culture to 'en-US' (Kendo UI has a bug related to editing decimal values in other cultures). Like currently it's done for admin area in Global.asax.cs 5 6 //var culture = new CultureInfo("en-US"); 7 var culture = new CultureInfo("zh-CN"); 8 9 Thread.CurrentThread.CurrentCulture = culture; 10 Thread.CurrentThread.CurrentUICulture = culture; 11 }
2. \Presentation\Nop.Web\Administration\Views\Shared\_AdminLayout.cshtml 文件中,添加簡體中文的js,以及引用。
1 //scripts 2 Html.AppendScriptParts(string.Format("~/Administration/Scripts/kendo/{0}/kendo.web.min.js", kendoVersion)); 3 Html.AppendScriptParts("~/Administration/Scripts/admin.search.js"); 4 Html.AppendScriptParts("~/Administration/scripts/admin.navigation.js"); 5 Html.AppendScriptParts("~/Administration/Scripts/admin.common.js"); 6 Html.AppendScriptParts("~/Administration/Scripts/typeahead/typeahead.bundle.min.js"); 7 Html.AppendScriptParts("~/Administration/Scripts/jquery-migrate-1.2.1.min.js"); 8 Html.AppendScriptParts("~/Administration/Scripts/jquery-ui-1.10.3.custom.min.js"); 9 Html.AppendScriptParts("~/Administration/Scripts/jquery.validate.unobtrusive.min.js"); 10 Html.AppendScriptParts("~/Administration/Scripts/jquery.validate.min.js"); 11 Html.AppendScriptParts("~/Administration/Scripts/adminLTE/app.min.js"); 12 Html.AppendScriptParts("~/Administration/Scripts/bootstrap/bootstrap.min.js"); 13 Html.AppendScriptParts("~/Administration/Scripts/jquery-1.10.2.min.js"); 14 15 Html.AppendScriptParts(string.Format("~/Administration/Scripts/kendo/{0}/cultures/kendo.culture.zh-CN.min.js", kendoVersion));
1 <title>@adminPageTitle</title> 2 <meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> 3 <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> 4 @Html.NopHeadCustom() 5 @Html.NopCssFiles(this.Url, ResourceLocation.Head, false) 6 @Html.NopScripts(this.Url, ResourceLocation.Head, false) 7 8 <script> 9 kendo.culture("zh-CN"); 10 </script>
編輯器的漢化,由於我直接用了百度編輯器,所以並沒有研究自帶的編輯器如何漢化,至於分頁中的一些英文提示,直接全文搜索,js裡替換成中文就好。
Over!