Note: There are only two solutions listed here to facilitate your memory.
1. A language design scheme defined using traditional resource files. For details, refer to Microsoft msdn.
2. Round Robin. The specific implementation is as follows.
1) Two database or file design columns: name1 and name2;
2) define the function for obtaining resources. Res. getstring (string name1_info)
3) The following calls res. getstring ("hello") for all the multilingual processing involved ");
4) Implementation of the res. getstring Function
Public static string getstring (string name1_info)
{
If (current language = "zh_cn ")
{
Return name1_info;
}
Else
{
// Obtain data from the database
VaR STR = dB. Table. Select (P => P. name1 = name1_info). firstordefault ();
If (STR = NULL)
{
// Write the current value to the database if no value is found
DB. Table. insert (name1_info ,"");
STR = name1_info;
}
Return STR;
}
}
5 ).ProgramAfter running for a period of time, implement name2 translation based on the database name1.