你的位置:首页 > ASP.net教程

[ASP.net教程]DevExpress 14.2 批量汉化 以及客户端的汉化


 

DXperience汉化方法介绍

运用慧都提供的DXperience汉化包,能将最新版本的DXperience WinForm和ASP.NET控件界面、弹出框、右键菜单等汉化成中文,且能根据自己的需求定制个性化的DXperience本地化。结合汉化文档说明,仅需一行代码就可实现DXperience汉化,至少能节约30%的开发时间!下面就跟大家讲一讲DXperience的汉化方法

怎样汉化DXperience

DXperience汉化方法总结起来,主要有以下几种方式:

1、利用已经汉化好的资源包;
2、使用本地对象类,利用代码汉化;
3、资源包和代码结合。

个人比较喜欢第一种方式,因为这种方法最简单实用。

DXperience汉化包怎么用

首先要先下载DXperience汉化包(DXperience资源包汉化 如需最新版本请联系客服购买,只需少量花费便可节约大量开发成本)。将所需汉化的资源zh-CHS中国 (简体) 、zh-CN中国 (中国)、zh-TW 中国 (台湾)拷贝到执行目录下,利用CurrentThread.CurrentUICulture加载资源包。参照代码如下:

static void Main(){System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CHS");Application.Run(new Form1());}

如何修改DXperience汉化包

汉化包有一个跟DXperience控件同样的强名密钥文件StrongKey.snk。如果想编译资源文件,只要你有控件完整的源代码,重新指定强名密钥文件,获得自己的StrongKey.snk。具体实现可查阅MSDN Library。

拷贝StrongKey.snk从安装的源代码的目录"Program Files"Developer Express .NET vX.Y"Sources"DevExpress.Key" 到当前资源包的DevExpress.Key目录。(vX.Y为当前安装版本号)

打开资源包Localization.sln工程,根据下面提及的使用本地化方法找出要汉化的属性,当然如果你购买了源代码也可以查看源代码Localization类里面的本地化方法列出的变量来实现你需要的汉化。

重新生成资源文件,这时对应的Dll将在DevExpress.DLL文件夹中。

DXperience WebForm(ASPxControls)汉化效果图

DXperience,DXperience WebForm,ASPxControls,DXperience汉化

DXperience WinForm汉化效果图

DXperience WinForm,WinForm汉化,DXperience汉化

汉化部分控件的方法

1、下载DevExpress_.NET_Localization_Resources_14.2汉化包

2、解压后将zh-CN或zh-CHS复制到安装目录如D:\Program Files (x86)\DevExpress 14.2\Components\Bin\Framework

3、在开始菜中找到Visual Studio 命令提示(2010),并以管理员身份运行(WIN7,8)

4、切换命令行当前目录到D:\Program Files (x86)\DevExpress 14.2\Components\Bin\Framework\zh-CN

5、运行dir /B *.dll >>temp.bat,在当前目录中得到所有dll列表

6、用记事本打开D:\Program Files (x86)\DevExpress 14.2\Components\Bin\Framework\zh-CN\temp.bat

7、通过替换功能将 DevExpress.Charts.Designer.v14.2.resources.dll 处理成 gacutil -i DevExpress.Charts.Designer.v14.2.resources.dll

8、保存temp.bat

9、在命令行窗口中输入temp.bat

10、汉化完成,删除临时文件temp.bat

PS: 不通过 Visual Studio 命令提示(2010) 执行会提示 :'gacutil' 不是内部或外部命令,也不是可运行的程序或批处理文件。

处理好的文件列表

gacutil -i DevExpress.Charts.Designer.v14.2.resources.dllgacutil -i DevExpress.Dashboard.v14.2.Core.resources.dllgacutil -i DevExpress.Dashboard.v14.2.Web.resources.dllgacutil -i DevExpress.Dashboard.v14.2.Win.resources.dllgacutil -i DevExpress.Data.v14.2.resources.dllgacutil -i DevExpress.DataAccess.v14.2.resources.dllgacutil -i DevExpress.DataAccess.v14.2.UI.resources.dllgacutil -i DevExpress.ExpressApp.HtmlPropertyEditor.Win.v14.2.resources.dllgacutil -i DevExpress.ExpressApp.PivotChart.v14.2.resources.dllgacutil -i DevExpress.ExpressApp.Reports.v14.2.resources.dllgacutil -i DevExpress.ExpressApp.Scheduler.v14.2.resources.dllgacutil -i DevExpress.ExpressApp.Scheduler.Web.v14.2.resources.dllgacutil -i DevExpress.ExpressApp.Security.v14.2.resources.dllgacutil -i DevExpress.ExpressApp.v14.2.resources.dllgacutil -i DevExpress.ExpressApp.Validation.v14.2.resources.dllgacutil -i DevExpress.ExpressApp.Web.v14.2.resources.dllgacutil -i DevExpress.ExpressApp.Win.v14.2.resources.dllgacutil -i DevExpress.Map.v14.2.Core.resources.dllgacutil -i DevExpress.Office.v14.2.Core.resources.dllgacutil -i DevExpress.Pdf.v14.2.Core.resources.dllgacutil -i DevExpress.PivotGrid.v14.2.Core.resources.dllgacutil -i DevExpress.Printing.v14.2.Core.resources.dllgacutil -i DevExpress.RichEdit.v14.2.Core.resources.dllgacutil -i DevExpress.Snap.v14.2.Core.resources.dllgacutil -i DevExpress.Snap.v14.2.Extensions.resources.dllgacutil -i DevExpress.Snap.v14.2.resources.dllgacutil -i DevExpress.Sparkline.v14.2.Core.resources.dllgacutil -i DevExpress.Spreadsheet.v14.2.Core.resources.dllgacutil -i DevExpress.Utils.v14.2.resources.dllgacutil -i DevExpress.Utils.v14.2.UI.resources.dllgacutil -i DevExpress.Web.ASPxHtmlEditor.v14.2.resources.dllgacutil -i DevExpress.Web.ASPxRichEdit.v14.2.resources.dllgacutil -i DevExpress.Web.ASPxScheduler.v14.2.resources.dllgacutil -i DevExpress.Web.ASPxSpellChecker.v14.2.resources.dllgacutil -i DevExpress.Web.ASPxSpreadsheet.v14.2.resources.dllgacutil -i DevExpress.Web.ASPxTreeList.v14.2.resources.dllgacutil -i DevExpress.Web.v14.2.resources.dllgacutil -i DevExpress.Xpf.Charts.v14.2.resources.dllgacutil -i DevExpress.Xpf.Controls.v14.2.resources.dllgacutil -i DevExpress.Xpf.Core.v14.2.resources.dllgacutil -i DevExpress.Xpf.Docking.v14.2.resources.dllgacutil -i DevExpress.Xpf.Gauges.v14.2.resources.dllgacutil -i DevExpress.Xpf.Grid.v14.2.Core.resources.dllgacutil -i DevExpress.Xpf.LayoutControl.v14.2.resources.dllgacutil -i DevExpress.Xpf.NavBar.v14.2.resources.dllgacutil -i DevExpress.Xpf.PdfViewer.v14.2.resources.dllgacutil -i DevExpress.Xpf.Printing.v14.2.resources.dllgacutil -i DevExpress.Xpf.PropertyGrid.v14.2.resources.dllgacutil -i DevExpress.Xpf.ReportDesigner.v14.2.resources.dllgacutil -i DevExpress.Xpf.Ribbon.v14.2.resources.dllgacutil -i DevExpress.Xpf.RichEdit.v14.2.resources.dllgacutil -i DevExpress.Xpf.Scheduler.v14.2.resources.dllgacutil -i DevExpress.Xpf.SpellChecker.v14.2.resources.dllgacutil -i DevExpress.Xpo.v14.2.resources.dllgacutil -i DevExpress.XtraBars.v14.2.resources.dllgacutil -i DevExpress.XtraCharts.v14.2.resources.dllgacutil -i DevExpress.XtraCharts.v14.2.Wizard.resources.dllgacutil -i DevExpress.XtraEditors.v14.2.resources.dllgacutil -i DevExpress.XtraGauges.v14.2.Core.resources.dllgacutil -i DevExpress.XtraGauges.v14.2.Presets.resources.dllgacutil -i DevExpress.XtraGrid.v14.2.resources.dllgacutil -i DevExpress.XtraLayout.v14.2.resources.dllgacutil -i DevExpress.XtraNavBar.v14.2.resources.dllgacutil -i DevExpress.XtraPdfViewer.v14.2.resources.dllgacutil -i DevExpress.XtraPivotGrid.v14.2.resources.dllgacutil -i DevExpress.XtraPrinting.v14.2.resources.dllgacutil -i DevExpress.XtraReports.v14.2.Extensions.resources.dllgacutil -i DevExpress.XtraReports.v14.2.resources.dllgacutil -i DevExpress.XtraReports.v14.2.Web.resources.dllgacutil -i DevExpress.XtraRichEdit.v14.2.Extensions.resources.dllgacutil -i DevExpress.XtraRichEdit.v14.2.resources.dllgacutil -i DevExpress.XtraScheduler.v14.2.Core.resources.dllgacutil -i DevExpress.XtraScheduler.v14.2.Extensions.resources.dllgacutil -i DevExpress.XtraScheduler.v14.2.Reporting.resources.dllgacutil -i DevExpress.XtraScheduler.v14.2.resources.dllgacutil -i DevExpress.XtraSpellChecker.v14.2.resources.dllgacutil -i DevExpress.XtraSpreadsheet.v14.2.resources.dllgacutil -i DevExpress.XtraTreeList.v14.2.resources.dllgacutil -i DevExpress.XtraVerticalGrid.v14.2.resources.dllgacutil -i DevExpress.XtraWizard.v14.2.resources.dll