[DXperience] 如何本地化.NET Windows窗体组件?

来源:互联网 发布:思博网络培训怎么样 编辑:程序博客网 时间:2024/05/16 17:15

转摘自DevExpress官方网站,原文地址:http://www.devexpress.com/Support/Center/KB/p/A421.aspx

How to localize .Net Windows Forms components

Article ID: A421 ; Product Group: .NET ; Product: DXperience Enterprise ; Modified On: 18 十月 2007

Description

What is the best way to localize (translate) your .Net products, the XtraPrinting Library for instance?

Solution

Applies to:
The components for .NET Windows Forms included in the DXperience suite

The best solution is to localize components' resources and build satellite assemblies. Please see the Localization topic in the XtraEditors' documentation. The same approach is applicable to localizing the XtraGrid, XtraPrinting Library and other products. In brief, you should change the strings in the RESX files for all our products and send the modified files to the Support Team. We will then build satellite assemblies signed by our strongkey token for you.

Where Do I Get RESX Files for Translation?
If you purchase a component without source code, resource files are not installed on your system. The resource files you need for translation are included in the attached archive (the !Neutral subfolder).

Please see the What's New document in the !Neutral folder if you need to update existing translations after installing new versions of the Developer Express components.

Already Available Translations
The attached files also contain the signed satellite assemblies. The file name contains the last updated date and the product version number for easier reference. You will need to extract the assemblies from the archive and add them to the Assembly Cache or to your application's folder.

Currently, we have translations for the following languages. The translated resource files were kindly sent to us by our customers.

Catalan ca: Editors, Grid, Printing, TreeList
Chinese (China) zh-CN: Bars
Chinese (Simplified) zh-CHS: Utils, Bars, Charts, Editors, Grid, Layout, NavBar, PivotGrid, Printing, Reports, RichTextEdit, Scheduler, SpellChecker, TreeList, VerticalGrid
Chinese (Taiwain) zh-TW: Data, Utils, Bars, Grid, Layout, NavBar, PivotGrid, TreeList, VerticalGrid
Croatian hr: Scheduler
Czech cs: Data, Utils, Xpo, Bars, Charts, Editors, Grid, Layout, NavBar, PivotGrid, Printing Library, Reports, RichTextEdit, Scheduler, SpellChecker, TreeList, VerticalGrid
Danish da: Bars, Editors, Grid, NavBar, PivotGrid, Printing Library, Reports, Scheduler, TreeList, VerticalGrid
Dutch nl: Data, Utils, Bars, Charts, Editors, Grid, Layout, NavBar, PivotGrid, Printing Library, Reports, RichTextEdit, Scheduler, SpellChecker, TreeList, VerticalGrid
Finnish fi-FI: Data, Utils, Bars, Charts, Editors, Grid, Layout, NavBar, PivotGrid, Printing Library, Reports, RichTextEdit, Scheduler, SpellChecker, TreeList, VerticalGrid
French fr: Utils, Bars, Editors, Grid, Layout, NavBar, Printing Library, Reports, Scheduler, TreeList, VerticalGrid
German de: Data, Utils, Xpo, Bars, Charts, Editors, Grid, Layout, NavBar, PivotGrid, Printing, Reports, RichTextEdit, Scheduler, SpellChecker, TreeList, VerticalGrid
Greek el: Utils, Bars, Editors, Grid, PivotGrid, Printing Library, Reports
Icelandic is-IS: Utils, Bars, Editors, Grid, NavBar, Printing Library, Reports, RichTextEdit, TreeList, VerticalGrid
Italian it: Data, Utils, Bars, Editors, Grid, NavBar, PivotGrid, Printing Library, Reports, Scheduler, TreeList, VerticalGrid
Japanese ja: Utils, Bars, Editors, Grid, NavBar, Printing Library, TreeList
Norwegian (Bokmål) no: Bars, Editors, Grid, Layout, NavBar, PivotGrid, Printing Library, Reports, TreeList, VerticalGrid
Polish pl: Data, Utils, Xpo, Bars, Charts, Editors, Grid, Layout, NavBar, PivotGrid, Printing Library, Reports, RichTextEdit, Scheduler, SpellChecker, TreeList, VerticalGrid
Portuguese pt: Utils, Bars, Charts, Editors, Grid, Layout, NavBar, PivotGrid, Printing Library, Reports, Scheduler, TreeList, VerticalGrid
Portuguese (Brazil) pt-BR: Utils, Bars, Charts, Editors, Grid, Layout, NavBar, PivotGrid, Printing Library, Reports, RichTextEdit, Scheduler, TreeList, VerticalGrid
Romanian ro: Data, Utils, Bars, Charts, Editors, Grid, Layout, NavBar, PivotGrid, Printing Library, Reports, RichTextEdit, TreeList, VerticalGrid
Russian ru: Bars, Editors, Grid, NavBar, PivotGrid, Printing Library, Reports, Scheduler, TreeList, VerticalGrid
Slovenian sl: Bars, Editors, Grid, NavBar, PivotGrid, Printing Library, Reports, TreeList, VerticalGrid
Spanish es: Data, Utils, Xpo, Bars, Charts, Editors, Grid, Layout, NavBar, PivotGrid, Printing Library, Reports, RichTextEdit, Scheduler, SpellChecker, TreeList, VerticalGrid
Swedish sw: Scheduler
Vietnamese vi: Editors, Grid

If You Decide to Recompile Satellite Assemblies Yourself
Satellite assemblies must be signed with the same strong key token as the main DevExpress.~ assemblies. We don't distribute our key file - it's our signature. Therefore, you will need to rebuild our assemblies as well if you want to compile resource files yourself. To generate a key token please use the sn.exe tool from .NET Framework SDK. Please refer to the How to rebuild assemblies from the source code article for guidelines on rebuilding our assemblies.

The batch files in the attachments can help you recompile the localized resources. You will need to check whether the paths defined for the KEYFILE, al, and resgen variables are correct for your system. These variables are defined in DefineVersions.bat, NET1.bat, and NET2.bat.

By the way, if you find mistakes or complete the existing translations, we'd appreciate it if you'd send your corrections to us for publishing here.

About the Test Project
You can test the localization of components by using the attached test project (it has been already included in dxKB0421_DXperience_6.3*.zip and dxKB0421_DXperience_7.1*.zip). This project utilizes almost all the controls of the Windows Forms Collection / DXperience component set. The UI language is set programmatically in the Main procedure, so you don't have to change your system regional settings to test given translations. Please follow the instructions in the comment to the Main procedure. When the project is launched you should see that some or all the component strings are translated to the language you've specified in the CurrentUICulture. Please note that this is true for the component internal strings, such as the XtraGrid's column context menu, the Print Preview menus, etc. Captions of the controls on test forms, e.g. buttons, NavBar groups, toolbar items, etc., are not localized, because the form is not localized in this test project. Of course you can localize all elements of your forms in your real project. Please see the Localizing Windows Forms article in the MSDN Library for details.

See Also:
Localization of the XtraEditors
Localizing Applications in the MSDN Library
Packaging and Deploying Resources
ClickOnce Deployment and Localization
How to translate components via their Localizer objects

Attachments

  • dxKB0421_DXperience_6.1_(2007-02-09).zip (3462333 bytes)
  • dxKB0421_DXperience_6.2_(2007-02-27).zip (4834670 bytes)
  • dxKB0421_DXperience_6.3_(2007-06-19).zip (6287116 bytes)
  • dxKB0421_DXperience_7.1_(2007-10-19).zip (8172762 bytes)
  • dxKB0421_DXperience_7.2_(2007-10-19).zip (8790788 bytes)
  • dxKB0421_DXperience_7.3_(2007-11-21).zip (8424512 bytes)
  • dxKB0421_WinForms_1.3.1_(2005-12-09).zip (849115 bytes)
  • dxKB0421_WinForms_2.2.5_(2006-03-17).zip (2511803 bytes)