`

DevExpress汉化(WinForm)

阅读更多
/*
*隔壁老王原创,2013-09-21,转载请保留本人信息及本文地址。
*本文地址:http://wallimn.iteye.com/blog/1944191
*/

  最简单的方式就是使用汉化资源,但我怎么也没有搞好,可能跟我使用PJ版的有关。没有办法,只能重定义Localizer了,这样汉化不太彻底,但自由度较高。

  重定义Localizer的难点就是不好找到原来对应的英文字符串,如果自己一个个翻译也比较费劲儿。看着下载的汉化资源,分析了一下对应的资源源文件,发现就是XML格式的文件,可以简单地用正则表达式把需要的信息提取出来。

  这个正则表达式不太难写,虽然我不太精通,但试了几下就把正则表达式写好了。
  搜索:<data name="(.*?)" xml:space="preserve">\n.*<value>(.*?)</value>\n.*</data>
  替换:case \1: return "\2" ;

  有时搜索这个:<data name="(.*?)" xml:space="preserve">\n.*<value>(.*?)</value>\n.*\n.*</data>
  使用EmEditor,使用正则表达式进行替换。很容易地就生成了C#用的case语句。

  我用的DevExpress版本是8.1.2,把我的成果贴一下,代码中,还对没有汉化的资源,在输出窗口进行了输出,如果发现需要汉化的,可以自己进行补充:
using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.XtraGrid.Localization;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraBars.Localization;
using DevExpress.XtraTreeList.Localization;
using DevExpress.XtraVerticalGrid.Localization;
using DevExpress.XtraLayout.Localization;
using DevExpress.XtraNavBar;

namespace Wallimn_Pro
{
    /// <summary>
    /// 汉化简化辅助类
    /// </summary>
    public class DevExpressLocalizerHelper
    {
        public static void SetSimpleChinese()
        {
            DevExpress.XtraGrid.Localization.GridLocalizer.Active = new XtraGridLocalizer_zh_chs();
            DevExpress.XtraGrid.Localization.GridResLocalizer.Active = new XtraGridLocalizer_zh_chs();
            DevExpress.XtraLayout.Localization.LayoutLocalizer.Active = new XtraLayoutLocalizer_zh_chs();
            DevExpress.XtraLayout.Localization.LayoutResLocalizer.Active = new XtraLayoutLocalizer_zh_chs();
            DevExpress.XtraEditors.Controls.Localizer.Active = new XtraEditorLocalizer_zh_chs();
            DevExpress.XtraBars.Localization.BarLocalizer.Active = new XtraBarsLocalizer_zh_chs();
            DevExpress.XtraBars.Localization.BarResLocalizer.Active = new XtraBarsLocalizer_zh_chs();
            DevExpress.XtraTreeList.Localization.TreeListLocalizer.Active = new XtraTreeListLocalizer_zh_chs();
            DevExpress.XtraTreeList.Localization.TreeListResLocalizer.Active = new XtraTreeListLocalizer_zh_chs();
            DevExpress.XtraVerticalGrid.Localization.VGridLocalizer.Active = new XtraVerticalGridLocalizer_zh_chs();
            DevExpress.XtraVerticalGrid.Localization.VGridResLocalizer.Active = new XtraVerticalGridLocalizer_zh_chs();
            DevExpress.XtraNavBar.NavBarLocalizer.Active = new NavBarLocalizer_zh_chs();
            DevExpress.XtraNavBar.NavBarResLocalizer.Active = new NavBarLocalizer_zh_chs();
        }
        public static String Language="zh-chs";
    }


    public class XtraGridLocalizer_zh_chs : DevExpress.XtraGrid.Localization.GridLocalizer
    {
        public override string Language
        {
            get
            {
                return DevExpressLocalizerHelper.Language;
            }
        }
        public override string GetLocalizedString(DevExpress.XtraGrid.Localization.GridStringId id)
        {
            switch (id)
            {
                case GridStringId.FileIsNotFoundError: return "文件{0}找不到";
                case GridStringId.ColumnViewExceptionMessage: return " 要修正当前值吗?";
                case GridStringId.CustomizationCaption: return "自定义";
                case GridStringId.CustomizationColumns: return "列";
                case GridStringId.CustomizationBands: return "带宽";
                case GridStringId.PopupFilterAll: return "(全部)";
                case GridStringId.PopupFilterCustom: return "(自定义)";
                case GridStringId.PopupFilterBlanks: return "(空白)";
                case GridStringId.PopupFilterNonBlanks: return "(无空白)";
                case GridStringId.CustomFilterDialogFormCaption: return "用户自定义自动过滤器";
                case GridStringId.CustomFilterDialogCaption: return "显示符合下列条件的行:";
                case GridStringId.CustomFilterDialogRadioAnd: return "于(&A)";
                case GridStringId.CustomFilterDialogRadioOr: return "或(&O)";
                case GridStringId.CustomFilterDialogOkButton: return "确定(&O)";
                case GridStringId.CustomFilterDialogClearFilter: return "清除过滤器(&L)";
                case GridStringId.CustomFilterDialogCancelButton: return "取消(&C)";
                case GridStringId.CustomFilterDialog2FieldCheck: return "字段";
                case GridStringId.CustomFilterDialogConditionEQU: return "等于";
                case GridStringId.CustomFilterDialogConditionNEQ: return "不等于";
                case GridStringId.CustomFilterDialogConditionGT: return "大于";
                case GridStringId.CustomFilterDialogConditionGTE: return "大于或等于";
                case GridStringId.CustomFilterDialogConditionLT: return "小于";
                case GridStringId.CustomFilterDialogConditionLTE: return "小于或等于";
                case GridStringId.CustomFilterDialogConditionBlanks: return "空白";
                case GridStringId.CustomFilterDialogConditionNonBlanks: return "非空白";
                case GridStringId.CustomFilterDialogConditionLike: return "近似于";
                case GridStringId.CustomFilterDialogConditionNotLike: return "不相似";
                case GridStringId.MenuFooterSum: return "和";
                case GridStringId.MenuFooterMin: return "最小值";
                case GridStringId.MenuFooterMax: return "最大值";
                case GridStringId.MenuFooterCount: return "计数";
                case GridStringId.MenuFooterAverage: return "平均值";
                case GridStringId.MenuFooterNone: return "无";
                case GridStringId.MenuFooterSumFormat: return "和={0:#.##}";
                case GridStringId.MenuFooterMinFormat: return "最小值={0}";
                case GridStringId.MenuFooterMaxFormat: return "最大值={0}";
                case GridStringId.MenuFooterCountFormat: return "{0}";
                case GridStringId.MenuFooterCountGroupFormat: return "计数={0}";
                case GridStringId.MenuFooterAverageFormat: return "平均={0:#.##}";
                case GridStringId.MenuFooterCustomFormat: return "统计值={0}";
                case GridStringId.MenuColumnSortAscending: return "升序排列";
                case GridStringId.MenuColumnSortDescending: return "降序排列";
                case GridStringId.MenuColumnClearSorting: return "清除排序设置";
                case GridStringId.MenuColumnGroup: return "根据此列分组";
                case GridStringId.FilterPanelCustomizeButton: return "自定义";
                case GridStringId.MenuColumnUnGroup: return "不分组";
                case GridStringId.MenuColumnColumnCustomization: return "列选择";
                case GridStringId.MenuColumnBestFit: return "最佳匹配";
                case GridStringId.MenuColumnFilter: return "允许筛选数据";
                case GridStringId.MenuColumnFilterEditor: return "设定数据筛选条件";
                case GridStringId.MenuColumnClearFilter: return "清除过滤器";
                case GridStringId.MenuColumnBestFitAllColumns: return "最佳匹配(所有列)";
                case GridStringId.MenuGroupPanelFullExpand: return "全部展开";
                case GridStringId.MenuGroupPanelFullCollapse: return "全部收合";
                case GridStringId.MenuGroupPanelClearGrouping: return "清除分组";
                case GridStringId.PrintDesignerBandedView: return "打印设置 (Banded View)";
                case GridStringId.PrintDesignerGridView: return "打印设置(网格视图)";
                case GridStringId.PrintDesignerCardView: return "打印设置(卡视图)";
                case GridStringId.PrintDesignerBandHeader: return "起始带宽";
                case GridStringId.PrintDesignerDescription: return "为当前视图设置不同的打印选项";
                case GridStringId.MenuColumnGroupBox: return "分组依据框";
                case GridStringId.CardViewNewCard: return "新建卡";
                case GridStringId.CardViewQuickCustomizationButton: return "自定义";
                case GridStringId.CardViewQuickCustomizationButtonFilter: return "过滤器 ";
                case GridStringId.CardViewQuickCustomizationButtonSort: return "排序方式:";
                case GridStringId.GridGroupPanelText: return "拖动列标题至此,根据该列分组";
                case GridStringId.GridNewRowText: return "在此处添加一行";
                case GridStringId.FilterBuilderOkButton: return "确定(&O)";
                case GridStringId.FilterBuilderCancelButton: return "取消(&C)";
                case GridStringId.FilterBuilderApplyButton: return "应用(&A)";
                case GridStringId.FilterBuilderCaption: return "数据筛选条件设定:";
                case GridStringId.GridOutlookIntervals: return "更早;上个月;三周之前;两周之前;上周;;;;;;;;昨天;今天;明天;;;;;;;;下周;两周后;三周后;下个月;一个月之后;";
            }
            System.Diagnostics.Debug.WriteLine(id.ToString() + "的默认值(" + this.GetType().ToString() + ")=" + base.GetLocalizedString(id));
            return base.GetLocalizedString(id);
        }
    }

    public class XtraEditorLocalizer_zh_chs : DevExpress.XtraEditors.Controls.Localizer
    {
        public override string Language
        {
            get
            {
                return DevExpressLocalizerHelper.Language;
            }
        }

        public override string GetLocalizedString(DevExpress.XtraEditors.Controls.StringId id)
        {
            switch (id)
            {
                case StringId.PictureEditOpenFileFilter: return ";*.ico;*.位图文件 (*.bmp)|*.bmp|GIF文件 (*.gif)|*.gif|JPEG文件 (*.jpg;*.jpeg)|*.jpg;*.jpeg|Icon 文件 (*.ico)|*.ico|所有图像文件 |*.bmp;*.gif;*.jpg;*.jpeg;*.ico;*.png;*.tif|所有文件 |*.*";
                case StringId.NavigatorNextButtonHint: return "下一个";
                case StringId.ImagePopupPicture: return "(图像)";
                case StringId.TabHeaderButtonNext: return "向右滚动";
                case StringId.TabHeaderButtonPrev: return "向左滚动";
                case StringId.XtraMessageBoxOkButtonText: return "确定(&O)";
                case StringId.Cancel: return "取消(&C)l";
                case StringId.DateEditToday: return "今天";
                case StringId.DateEditClear: return "清除";
                case StringId.PictureEditMenuCut: return "剪切";
                case StringId.NavigatorEditButtonHint: return "编辑";
                case StringId.TextEditMenuCut: return "剪切(&t)";
                case StringId.ImagePopupEmpty: return "(空)";
                case StringId.NavigatorNextPageButtonHint: return "下一页";
                case StringId.NavigatorTextStringFormat: return "记录 {0} of {1}";
                case StringId.CaptionError: return "错误";
                case StringId.XtraMessageBoxNoButtonText: return "否(&N)";
                case StringId.PictureEditOpenFileTitle: return "打开";
                case StringId.PictureEditOpenFileError: return "错误的图像格式";
                case StringId.XtraMessageBoxIgnoreButtonText: return "忽略(&I)";
                case StringId.NavigatorRemoveButtonHint: return "删除";
                case StringId.TabHeaderButtonClose: return "关闭";
                case StringId.CheckUnchecked: return "非校验";
                case StringId.PictureEditSaveFileFilter: return "位图文件 (*.bmp)|*.bmp|GIF文件 (*.gif)|*.gif|JPEG 文件 (*.jpg)|*.jpg";
                case StringId.TextEditMenuSelectAll: return "全选(&A)";
                case StringId.PictureEditSaveFileTitle: return "另存为";
                case StringId.DataEmpty: return "没有图像数据";
                case StringId.XtraMessageBoxAbortButtonText: return "中断(&A)";
                case StringId.CheckIndeterminate: return "不确定";
                case StringId.NavigatorLastButtonHint: return "最后一个";
                case StringId.TextEditMenuCopy: return "复制(&C)";
                case StringId.TextEditMenuUndo: return "撤销(&U)";
                case StringId.CalcError: return "计算错误";
                case StringId.CalcButtonBack: return "后退";
                case StringId.CalcButtonSqrt: return "平方根";
                case StringId.LookUpColumnDefaultName: return "名称";
                case StringId.NavigatorEndEditButtonHint: return "结束编辑";
                case StringId.NotValidArrayLength: return "无效的数组长度。";
                case StringId.ColorTabWeb: return "网页";
                case StringId.PictureEditMenuSave: return "保存";
                case StringId.PictureEditMenuCopy: return "复制";
                case StringId.PictureEditMenuLoad: return "调用";
                case StringId.NavigatorFirstButtonHint: return "第一个";
                case StringId.MaskBoxValidateError: return @"输入值不完整,是否修正?
	
	
	是 - 返回编辑器,修正该值.
	否 -保留该值.
	取消 - 重设为原来的值.";
                case StringId.UnknownPictureFormat: return "未知的图形格式";
                case StringId.NavigatorPreviousPageButtonHint: return "前一页";
                case StringId.XtraMessageBoxRetryButtonText: return "重试(&R)";
                case StringId.LookUpEditValueIsNull: return "[编辑值为空]";
                case StringId.CalcButtonC: return "C";
                case StringId.XtraMessageBoxCancelButtonText: return "取消(&C)l";
                case StringId.LookUpInvalidEditValueType: return "无效的 LookUpEdit 编辑值类型。";
                case StringId.NavigatorAppendButtonHint: return "追加";
                case StringId.CalcButtonMx: return "M+";
                case StringId.CalcButtonMC: return "MC";
                case StringId.CalcButtonMS: return "MS";
                case StringId.CalcButtonMR: return "MR";
                case StringId.CalcButtonCE: return "CE";
                case StringId.NavigatorCancelEditButtonHint: return "取消编辑";
                case StringId.PictureEditOpenFileErrorCaption: return "打开错误";
                case StringId.OK: return "确定(&O)";
                case StringId.CheckChecked: return "校验";
                case StringId.TextEditMenuPaste: return "粘贴(&P)";
                case StringId.TextEditMenuDelete: return "删除(&D)";
                case StringId.ColorTabSystem: return "系统";
                case StringId.PictureEditMenuPaste: return "粘贴";
                case StringId.XtraMessageBoxYesButtonText: return "是(&Y)";
                case StringId.InvalidValueText: return "无效值";
                case StringId.PictureEditMenuDelete: return "删除";
                case StringId.NavigatorPreviousButtonHint: return "前一个";
                case StringId.ColorTabCustom: return "自定义";
            }
            System.Diagnostics.Debug.WriteLine(id.ToString() + "的默认值("+this.GetType().ToString()+")=" + base.GetLocalizedString(id));
            return base.GetLocalizedString(id);
        }
    }

    public class XtraBarsLocalizer_zh_chs : DevExpress.XtraBars.Localization.BarLocalizer
    {
        public override string Language
        {
            get
            {
                return DevExpressLocalizerHelper.Language;
            }
        }

        public override string GetLocalizedString(DevExpress.XtraBars.Localization.BarString id)
        {
            switch (id)
            {
                case BarString.AddOrRemove: return "添加或删除按钮(&A)";
                case BarString.ResetBar: return "确定要对 '{0}' 工具栏所做的改动进行重置吗?";
                case BarString.ResetBarCaption: return "自定义";
                case BarString.ResetButton: return "重设工具栏(&R)";
                case BarString.CustomizeButton: return "自定义...(&C)";
                case BarString.ToolBarMenu: return "重新设定(&R)$刪除(&D)$!重新命名(&N)$!默认格式(&L)$全文字模式(&T)$文字菜单(&O)$图片及文字(&A)$!启用组(&G)$可见的(&V)$最近使用的(&M)";
                case BarString.NewToolbarName: return "工具";
                case BarString.NewMenuName: return "主菜单";
                case BarString.NewStatusBarName: return "状态栏";
                case BarString.NewToolbarCustomNameFormat: return "自定义{0}";
                case BarString.NewToolbarCaption: return "新建工具栏";
                case BarString.RenameToolbarCaption: return "重命名工具栏";
                case BarString.CustomizeWindowCaption: return "自定义";
                case BarString.MenuAnimationSystem: return "(系统默认值)";
                case BarString.MenuAnimationNone: return "无";
                case BarString.MenuAnimationSlide: return "片";
                case BarString.MenuAnimationFade: return "减弱";
                case BarString.MenuAnimationUnfold: return "展开";
                case BarString.MenuAnimationRandom: return "随机";
                case BarString.PopupMenuEditor: return "弹出菜单编辑器";
                case BarString.ToolbarNameCaption: return "工具栏名称(&T)";
                case BarString.RibbonToolbarBelow: return "将快速访问工具栏显示在功能区下方(&S)";
                case BarString.RibbonToolbarAbove: return "将快速访问工具栏显示在功能区上方(&S)";
                case BarString.RibbonToolbarRemove: return "移除快速访问工具栏(&R)";
                case BarString.RibbonToolbarAdd: return "添加快速访问工具栏(&A)";
                case BarString.RibbonToolbarMinimizeRibbon: return "最小化功能区(&N)";
                case BarString.RibbonGalleryFilter: return "所有组";
                case BarString.RibbonGalleryFilterNone: return "无";
                case BarString.BarUnassignedItems: return "(未设定项)";
                case BarString.BarAllItems: return "(所有项)";
                case BarString.RibbonUnassignedPages: return "(未设定页)";
                case BarString.RibbonAllPages: return "(所有页)";
            }
            System.Diagnostics.Debug.WriteLine(id.ToString() + "的默认值(" + this.GetType().ToString() + ")=" + base.GetLocalizedString(id));
            return base.GetLocalizedString(id);
        }

    }

    public class XtraTreeListLocalizer_zh_chs : DevExpress.XtraTreeList.Localization.TreeListLocalizer
    {
        public override string Language
        {
            get
            {
                return DevExpressLocalizerHelper.Language;
            }
        }
        public override string GetLocalizedString(DevExpress.XtraTreeList.Localization.TreeListStringId id)
        {
            switch (id)
            {
                case TreeListStringId.MenuColumnBestFit: return "最佳匹配";
                case TreeListStringId.PrintDesignerHeader: return "打印设置";
                case TreeListStringId.ColumnCustomizationText: return "自定义";
                case TreeListStringId.MenuFooterMin: return "最小值";
                case TreeListStringId.MenuFooterMax: return "最大值";
                case TreeListStringId.MenuFooterSum: return "和";
                case TreeListStringId.MenuFooterAllNodes: return "所有节点";
                case TreeListStringId.MenuFooterCount: return "计数";
                case TreeListStringId.MenuColumnSortAscending: return "升序排列";
                case TreeListStringId.MenuFooterNone: return "无";
                case TreeListStringId.MenuColumnSortDescending: return "降序排列";
                case TreeListStringId.PrintDesignerDescription: return "为当前的树状列表设置不同的打印选项";
                case TreeListStringId.MenuColumnBestFitAllColumns: return "最佳匹配 (所有列)";
                case TreeListStringId.MenuFooterAverageFormat: return "平均值={0:#.##}";
                case TreeListStringId.ColumnNamePrefix: return "列";
                case TreeListStringId.MenuFooterMinFormat: return "最小值={0}";
                case TreeListStringId.MenuFooterCountFormat: return "{0}";
                case TreeListStringId.MenuColumnColumnCustomization: return "列选择";
                case TreeListStringId.MenuFooterMaxFormat: return "最大值={0}";
                case TreeListStringId.MenuFooterSumFormat: return "和={0:#.##}";
                case TreeListStringId.MultiSelectMethodNotSupported: return "OptionsBehavior.MultiSelect未激活时,指定方法不能工作.";
                case TreeListStringId.InvalidNodeExceptionText: return " 要修正当前值吗?";
                case TreeListStringId.MenuFooterAverage: return "平均值";
            }
            System.Diagnostics.Debug.WriteLine(id.ToString() + "的默认值(" + this.GetType().ToString() + ")=" + base.GetLocalizedString(id));
            return base.GetLocalizedString(id);
        }
    }

    public class XtraVerticalGridLocalizer_zh_chs : DevExpress.XtraVerticalGrid.Localization.VGridLocalizer
    {
        public override string Language
        {
            get
            {
                return DevExpressLocalizerHelper.Language;
            }
        }
        public override string GetLocalizedString(DevExpress.XtraVerticalGrid.Localization.VGridStringId id)
        {
            switch (id)
            {
                case VGridStringId.RowCustomizationText: return "定制";
                case VGridStringId.RowCustomizationNewCategoryFormText: return "新增数据类别";
                case VGridStringId.RowCustomizationNewCategoryFormLabelText: return "标题:";
                case VGridStringId.RowCustomizationNewCategoryText: return "新增";
                case VGridStringId.RowCustomizationDeleteCategoryText: return "删除";
                case VGridStringId.InvalidRecordExceptionText: return "是否要修改不正确的数据值?";
                case VGridStringId.RowCustomizationTabPageCategoriesText: return "分类数据";
                case VGridStringId.RowCustomizationTabPageRowsText: return "数据列";
                case VGridStringId.StyleCreatorName: return "风格定制器";
            }
            System.Diagnostics.Debug.WriteLine(id.ToString() + "的默认值(" + this.GetType().ToString() + ")=" + base.GetLocalizedString(id));
            return base.GetLocalizedString(id);
        }
    }

    public class XtraLayoutLocalizer_zh_chs : DevExpress.XtraLayout.Localization.LayoutLocalizer
    {
        public override string Language
        {
            get
            {
                return DevExpressLocalizerHelper.Language;
            }
        }
        public override string GetLocalizedString(DevExpress.XtraLayout.Localization.LayoutStringId id)
        {
            switch (id)
            {
                case LayoutStringId.CustomizationParentName: return "定制";
                case LayoutStringId.DefaultItemText: return "项目";
                case LayoutStringId.DefaultActionText: return "默认动作";
                case LayoutStringId.DefaultEmptyText: return "无";
                case LayoutStringId.LayoutItemDescription: return "版面设计控制器的项目元素";
                case LayoutStringId.LayoutGroupDescription: return "版面设计控制器的群组元素";
                case LayoutStringId.TabbedGroupDescription: return "版面控制器的群组标签页元素";
                case LayoutStringId.LayoutControlDescription: return "版面控制";
                case LayoutStringId.CustomizationFormTitle: return "定制";
                case LayoutStringId.TreeViewPageTitle: return "版面设计树状视图";
                case LayoutStringId.HiddenItemsPageTitle: return "隐藏项目";
                case LayoutStringId.RenameSelected: return "重命名";
                case LayoutStringId.HideItemMenutext: return "隐藏项目";
                case LayoutStringId.LockItemSizeMenuText: return "锁定项目大小";
                case LayoutStringId.UnLockItemSizeMenuText: return "解除项目大小锁定";
                case LayoutStringId.GroupItemsMenuText: return "群组";
                case LayoutStringId.UnGroupItemsMenuText: return "解除群组设定";
                case LayoutStringId.CreateTabbedGroupMenuText: return "创建群组标签页";
                case LayoutStringId.AddTabMenuText: return "增加标签页";
                case LayoutStringId.UnGroupTabbedGroupMenuText: return "解除群组标签页设定";
                case LayoutStringId.TreeViewRootNodeName: return "最上层";
                case LayoutStringId.ShowCustomizationFormMenuText: return "定制版面";
                case LayoutStringId.HideCustomizationFormMenuText: return "隐藏定制表格";
                case LayoutStringId.EmptySpaceItemDefaultText: return "空白区域项目";
                case LayoutStringId.SplitterItemDefaultText: return "分隔器版面設計控制器的群組標籤頁項目";
                case LayoutStringId.ControlGroupDefaultText: return "群组";
                case LayoutStringId.EmptyRootGroupText: return "在这里放置控件";
                case LayoutStringId.EmptyTabbedGroupText: return "将群组拖放到群组标签页区域";
                case LayoutStringId.ResetLayoutMenuText: return "重设版面";
                case LayoutStringId.RenameMenuText: return "重命名";
                case LayoutStringId.TextPositionMenuText: return "文本位置";
                case LayoutStringId.TextPositionLeftMenuText: return "左边";
                case LayoutStringId.TextPositionRightMenuText: return "右边";
                case LayoutStringId.TextPositionTopMenuText: return "上方";
                case LayoutStringId.TextPositionBottomMenuText: return "下方";
                case LayoutStringId.ShowTextMenuItem: return "显示文本";
                case LayoutStringId.HideTextMenuItem: return "隐藏文本";
                case LayoutStringId.LockSizeMenuItem: return "锁定大小";
                case LayoutStringId.LockWidthMenuItem: return "锁定宽度";
                case LayoutStringId.CreateEmptySpaceItem: return "创建空白区域项目";
                case LayoutStringId.LockHeightMenuItem: return "锁定高度";
                case LayoutStringId.LockMenuGroup: return "强制限定大小";
                case LayoutStringId.FreeSizingMenuItem: return "允许改变大小";
                case LayoutStringId.ResetConstraintsToDefaultsMenuItem: return "重设为默认值";
            }
            System.Diagnostics.Debug.WriteLine(id.ToString() + "的默认值(" + this.GetType().ToString() + ")=" + base.GetLocalizedString(id));
            return base.GetLocalizedString(id);
        }
    }

    public class NavBarLocalizer_zh_chs : DevExpress.XtraNavBar.NavBarLocalizer
    {
        public override string Language
        {
            get
            {
                return DevExpressLocalizerHelper.Language;
            }
        }
        public override string GetLocalizedString(DevExpress.XtraNavBar.NavBarStringId id)
        {
            switch (id)
            {
                case NavBarStringId.NavPaneMenuAddRemoveButtons: return "添加或删除按钮(&A)";
                case NavBarStringId.NavPaneMenuShowMoreButtons: return "显示更多按钮(&M)";
                case NavBarStringId.NavPaneChevronHint: return "配置按钮";
                case NavBarStringId.NavPaneMenuShowFewerButtons: return "显示少量按钮(&F)";
            }
            System.Diagnostics.Debug.WriteLine(id.ToString() + "的默认值(" + this.GetType().ToString() + ")=" + base.GetLocalizedString(id));
            return base.GetLocalizedString(id);
        }
    }
}


  想要汉化,只需调用Wallimn_Pro.DevExpressLocalizerHelper.SetSimpleChinese();
2
2
分享到:
评论

相关推荐

    DevExpress .Net WinForm 简体汉化资源 及其调用方法

    首先,获取DevExpress .Net WinForm的简体汉化资源通常需要从DevExpress官方网站下载,这些资源通常包含语言包文件,例如DLL或XML文件,它们包含了所有控件的中文翻译。在下载过程中,请确保选择与你的DevExpress...

    DEVexpress 9.2.6 winform 中文

    以下是对DEVexpress 9.2.6 winform中文版的一些核心知识点的详细说明: 1. **Windows Forms**:Windows Forms是.NET Framework的一部分,它提供了一组丰富的用户界面控件和工具,用于构建桌面应用程序。DEVexpress ...

    DevExpress汉化包zh-Hans.rar

    本压缩包"DevExpress汉化包zh-Hans.rar"是DevExpress软件的中文语言包,主要用于将DevExpress的英文界面翻译成简体中文。对于那些习惯使用中文界面或者需要为中文用户开发应用的开发者来说,这是一个非常实用的资源...

    DevExpress8.2.4 汉化[winform]简体

    在安装或集成DevExpress汉化包时,这些文件会提供界面文本的翻译,确保所有DevExpress控件显示为中文,方便中国用户使用。 使用DevExpress汉化版时,开发者需要注意以下几点: 1. **集成汉化**:在项目中引用汉化...

    Devexpress 13.1.5 13.1.6 winform本地汉化类

    标题中的"Devexpress 13.1.5 13.1.6 winform本地汉化类"指的是在这些版本中,Devexpress对Winform平台的控件进行了汉化处理,使得中国用户能够更方便地理解和使用这些控件,而无需面对英文界面的困扰。汉化不仅包括...

    DevExpress 18.1 汉化包

    这个"DevExpress 18.1 汉化包"是专门为DevExpress的18.1版本提供的中文语言包,旨在帮助中国开发者和用户更方便地理解和使用DevExpress的各种功能。 DevExpress组件库涵盖了多种开发环境,包括WinForms、ASP.NET、...

    DevExpress 14.2 汉化包

    DevExpress 14.2汉化包就是专门为这个版本提供的中文语言支持,使得开发者能够在使用DevExpress组件时看到中文界面,更便于理解和操作。中文包通常包含了一整套的翻译资源文件,覆盖了DevExpress组件的所有界面元素...

    关于DevExPress 13.2.6汉化

    这个压缩包文件"关于DevExPress 13.2.6汉化"显然包含了针对DevExpress 13.2.6版本的中文语言资源,帮助中国开发者更好地理解和使用这个版本的产品。 DevExpress WinForms是专门针对Windows桌面应用开发的一套控件集...

    DevExpress15.2汉化组件+中文帮助文档.rar

    在这个“DevExpress15.2汉化组件+中文帮助文档.rar”压缩包中,包含了DevExpress 15.2版本的一些关键组件的汉化版本以及对应的中文帮助文档,这对于使用C#语言开发WinForm应用的开发者来说非常有帮助。 首先,我们...

    devexpress 14.2 汉化文件2 zh-Hans

    DevExpress 14.2 汉化文件2(zh-Hans)是针对DevExpress控件库的一个关键组件,主要用于将该版本的DevExpress产品翻译为简体中文。这个汉化包包含了多个资源DLL文件,确保了DevExpress的各个模块在中文环境下能够...

    DevExpress21.2及之前版本都可用

    DevExpress_Patch_Keygen_v2.5.0

    Devexpress dxperience 13.1.5汉化资源

    DevExpress.XtraGrid.Localization.GridResLocalizer.Active = new Dxper.LocalizationCHS.Win.XtraGridCHS(); DevExpress.XtraEditors.Controls.Localizer.Active = new Dxper.LocalizationCHS.Win.XtraEditorsCHS...

    DXpereince 9.1.5 官方汉化文件(WinForm用,适用于原版,2009-7-1更新)

    Devexpress官方的汉化文件,通过资源文件进行汉化,适用于原版或适用Danny Su的DevExpress.Registration注册插件安装的版本,和原版一致的强名,支持9.1各个版本汉化。 使用方法: 1、zh-CHS目录拷贝到生成的EXE程序...

    dev WinForm gridcontrol gridview 完全汉化

    以前从网上搜索下载的汉化都不是很全,结合前辈的成果,我在此又作了些补充,算是...//以下位置为汉化 DevExpress.XtraGrid.Localization.GridLocalizer.Active = new DevLocalizer(); Application.Run(new MainForm()); }

    Devexpress 9.2.* (WinForm) 汉化文件(官方正式版)

    官方版汉化文件,用法: 把汉化资源文件解压到程序发布文件夹(连目录一起:zh-cn), 在主程序文件加入两行代码,编译后运行即可。 例子程序如下: static class Program { [STAThread] static void Main() { ...

    DevExpress 13.1.8 破解(完全破解可发布)

    DevExpress 13.1.8 真正的完全破解,可发布。 使用方法: 1、将压缩文件中的DevExpress.Data.v13.1.dll、DevExpress.Utils.v13.1.dll两个文件替换原来的文件即可。发布不受影响,发布后也可使用。 2、如果已经安装过...

    DevExpress V12.1.X 汉化包

    "支持WPF,WinForm和WebForm"表示这个汉化包覆盖了DevExpress在三种主要.NET框架下的应用。WPF是一个面向Windows的高性能、灵活的用户界面框架,WinForms则适用于传统的桌面应用程序,而WebForm是ASP.NET的一部分,...

    DevExpress_NET_v20.2.6.0.rar

    DevExpress Universal包括DevExtreme,这是为iPhone、Android、iPad和微软Surface平板电脑构建多渠道应用程序的工具。它还包括CodeRush和获奖的eXpress应用程序框架,所有这些应用程序都在一个集成包中。WPF工具将为...

    Devexpress13.2全中文,含XAF、设计时刻、WinForm、ASP、WPF

    在"Devexpress13.2全中文,含XAF、设计时刻、WinForm、ASP、WPF"这个资源中,用户可以获得DevExpress 13.2.6版本的完整中文版,适用于13.2系列的所有版本。 1. DevExpress 13.2.6:这是一个关键版本,包含了该时期...

    DevExpressLocalizedResources-2018.2-zh-Hans 中文包

    DevExpress 是一家知名的软件开发公司,专门提供用于 Windows、Web 和移动平台的开发工具和服务。DevExpress 控件库广泛应用于创建高效且美观的用户界面,尤其在企业级应用开发中备受青睐。...

Global site tag (gtag.js) - Google Analytics