In the previous development platform, the multi-language function was implemented with the XML language package, and now the new platform has been adjusted to implement the multi-language package resources in the database table.
We have set up a multi-lingual configuration global variable and can switch to multiple languages by configuring this parameter.
We add a multi-lingual selection to the option management and then add the language resources
The following table is a multi-language database design table structure
The following figure is a set of resources in a multi-language database
This is a multi-language Settings Management Interface reference
The following is a multi-lingual management form location
Multi-language Example program reference:
/// <summary> ///Get multiple languages/// </summary> Public voidGetLanguage () { This. Grblanguage.text = This. GetLanguage ( This. Grblanguage); This. Lbllanguagecode.text = This. GetLanguage ( This. Lbllanguagecode) +":"; This. Lblmessagecode.text = This. GetLanguage ( This. Lblmessagecode) +":"; This. Lblcaption.text = This. GetLanguage ( This. lblcaption) +":"; This. Btnadd.text = This. GetLanguage ( This. Btnadd); This. Btnsave.text = This. GetLanguage ( This. Btnsave); This. Btncancel.text = This. GetLanguage ( This. Btncancel); } Public stringGetLanguage (Control control) {stringresult =string. Empty; stringKey = This. Name +"."+control. Name; stringCaption =control. Text; Result= ClientCache.Instance.GetLanguage ( This. UserInfo, Key, Basesysteminfo.currentlanguage, caption); returnresult; }
Multi-lingual Interface program reference:
//-----------------------------------------------------------------//All rights Reserved, Copyright (C), Hairihan TECH, Ltd.//-----------------------------------------------------------------usingSystem.Data;usingSystem.ServiceModel;usingSystem.Collections.Generic;namespacedotnet.iservice{usingdotnet.utilities; usingDotnet.model; /// <summary> ///Ilanguageservice///Multi-lingual interface/// ///Change of record/// ///2015.02.24 Version: 1.0 Jirigala Create a primary key. /// /// <author> /// <name>Jirigala</name> /// <date>2015.02.24</date> /// </author> /// </summary>[ServiceContract] Public InterfaceIlanguageservice {/// <summary> ///Get entity/// </summary> /// <param name= "UserInfo" >User</param> /// <param name= "id" >PRIMARY Key</param> /// <returns>Entity</returns>[OperationContract] baselanguageentity GetObject (baseuserinfo userInfo,stringID); /// <summary> ///Add/// </summary> /// <param name= "UserInfo" >User</param> /// <param name= "entity" >Entity</param> /// <param name= "StatusCode" >Return Status Code</param> /// <param name= "StatusMessage" >Return status information</param> /// <returns>PRIMARY Key</returns>[OperationContract]stringADD (Baseuserinfo userInfo, baselanguageentity entity, out stringStatusCode, out stringStatusMessage); /// <summary> ///Edit/// </summary> /// <param name= "UserInfo" >User</param> /// <param name= "entity" >Entity</param> /// <param name= "StatusCode" >Return Status Code</param> /// <param name= "StatusMessage" >Return status information</param> /// <returns>affect the number of rows</returns>[OperationContract]intUpdate (Baseuserinfo userInfo, baselanguageentity entity, out stringStatusCode, out stringStatusMessage); /// <summary> ///set up multiple languages/// </summary> /// <param name= "UserInfo" >User</param> /// <param name= "Messagecode" >language Number</param> /// <param name= "Enus" >English</param> /// <param name= "ZHCN" >Simplified Chinese</param> /// <param name= "ZHTW" >Traditional Chinese</param> /// <returns>affect the number of rows</returns>[OperationContract]intSetLanguage (Baseuserinfo UserInfo,stringMessagecode,stringEnus,stringZHCN,stringzhtw); /// <summary> ///get multiple languages by number/// </summary> /// <param name= "UserInfo" >User</param> /// <param name= "Messagecode" >language Number</param> /// <returns>List</returns>List<baselanguageentity> Getlanguagebymessagecode (Baseuserinfo userInfo,stringMessagecode); /// <summary> ///Bulk hit Delete flag/// </summary> /// <param name= "UserInfo" >User</param> /// <param name= "IDs" >primary Key Array</param> /// <returns>affect the number of rows</returns>[OperationContract]intSetdeleted (Baseuserinfo UserInfo,string[] IDs); /// <summary> ///Bulk Save/// </summary> /// <param name= "UserInfo" >User</param> /// <param name= "List" >List</param> /// <returns>affect the number of rows</returns>[OperationContract]intBatchSave (Baseuserinfo userInfo, list<baselanguageentity>list); }}
C#.net Large Enterprise Information System integration rapid development platform version 4.2-Multi-language implementation based on database resources