Implementation of Multi-language in RDIFramework.NET V2.9

Implementation of Multi-language in RDIFramework.NET V2.9

  Now is the era of internationalization, and software cannot be left behind. There may be foreigners in a company, as well as friends from Taiwan. They have different software habits. If the same software can adapt to multiple languages ​​and cultures at the same time, it is ideal, at least it can be more perfect. The English version is supported, and everyone will be more comfortable to use it.

  The multi-language packages in the RDIFramework.NET framework are currently organized in the form of XML files, which is convenient for users to freely define language packages. The main advantage of the XML language package is that it is easy for customers to modify it, and it can be corrected directly with Notepad. There is no need to recompile the source code, which is very trouble-free. Our framework currently mainly supports simplified Chinese, traditional Chinese, and English. Of course, if you need other language packs, you can make them yourself. The reference of multi-language implementation is shown in the figure below. These language packages directly store text files in the format of XML files, and require language support of several countries, as long as there are supporting packages.

1. Multilingual effect display

  

  The language pack configuration file is shown in the following figure:

  Simplified Chinese language pack reference:

 

  Traditional Chinese language pack reference: 

  English language pack reference:

  The above is the content reference in the language pack, the multi-language definition of the elements on each page, and "_" is used to distinguish the names of the controls in each form. The full name rule is: form name_control name . The multi-language of the RDIFramework.NET framework not only language the module interface, but also multi-language processing of log files and each message prompt frame. Documents are recorded in English.

 

  The prompt information is also displayed in the corresponding language pack settings, as shown in the following figure:

2. Multilingual effect switching method

  To show a multilingual program, first we have to enable the multilingual option, and then set the current language. There are two ways, one is by modifying the Config.xml file, as shown in the following figure:

  To enable multi-language, we need to set: MultiLanguage property is True , and also need to set the current language property of the " CurrentLanguage " framework, if not set, the default is Simplified Chinese, and the CurrentLanguage property value is:

      zh-CN : Simplified Chinese

  zh-TW : Traditional Chinese

  en-US : English

  Or set the current language through the "Options" form of the main interface of the framework, and restart the framework after setting. As shown below:

3. Multi-language calling interface

  The RDIFramework.NET framework supports multiple languages ​​for forms, user controls, etc. If the user defines the language according to the multi-language definition specification, he can directly call the interface in the RDIFramework.WinForm.Utilities.dll file:      

  BasePageLogic.SetLanguageResource (form name) to switch multiple languages.

  If it is a separate page from the framework, you can call the interface provided by "RDIFramework.Utilities.dll" in the load event:

1
2
3
4
5
6
// 多语言国际化加载
ResourceManagerWrapper.Instance.LoadResources(Path.Combine(Application.StartupPath, "Resource/Localization/" ));
// 从当前指定的语言包读取信息
RDIFrameworkMessage.GetLanguageResource();
//然后再调用下面的接口进行多语言的处理
ResourceManagerWrapper.Instance.Get( "当前语言" "语言包中的Key值" );

reference reading

RDIFramework.NET — Rapid Information System Development Framework Based on .NET — Series Catalog

RDIFramework.NET ━ .NET Rapid Information System Development Framework Juxian V2.9 Released

Over the years, thanks to the supporters and users of the RDIFramework.NET framework, the official website and official blog of RDIFramework.NET are now enabled, which you can access through the following places.

RDIFramework.NET官方网站:http://www.rdiframework.net/

RDIFramework.NET官方博客:http://blog.rdiframework.net/

      同时需要说明的,以后的所有技术文章以官方网站为准,欢迎大家收藏!

      RDIFramework.NET框架由专业团队长期打造、一直在更新、一直在升级,请放心使用! 

欢迎关注RDIFramework.NET框架官方公众微信(微信号:rdiframework-net),及时了解最新动态。

扫描二维码立即关注

RDIFramework.NET 官方微信

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326311924&siteId=291194637