Problems with software internationalization: C# gets the language version of the current windows system
I thought it had nothing to do with internationalization and was not within the scope of software consideration. I didn’t expect that occasionally a project still cannot be avoided. Please note
System.Globalization.CultureInfo.InstalledUICulture.Name This is the area code for obtaining English. That is, for zh-cn, you need to compare it with the area code dictionary.
System.Globalization.CultureInfo.InstalledUICulture.NativeName The name corresponding to the region code, such as: Chinese (China)
int lcid = System.Globalization.CultureInfo.CurrentCulture.LCID; Get the lcid of the language;
int lcid = System. Globalization.CultureInfo.CurrentCulture.LCID; //string nam = System.Globalization.CultureInfo.InstalledUICulture.Name; //string nam2 = System.Globalization.CultureInfo.InstalledUICulture.NativeName; if (lcid == 0x804 || lcid == 0xc04 || lcid == 0x1404 || lcid==0x1004 || lcid == 0x404)//Chinese, Chinese Hong Kong, Chinese Macau, Chinese Singapore, Chinese Taiwan { XXX.Chinese; } ///English ///English -Australia ///English -Belize ///English -Canada ///English -Gabil ///English -Ireland ///English -Jamaica ///English -New Zealand ///English -the Philippines ///English -South Africa ///English -Trinidad and Tobago ///English -U.K ///English -U.S ///English -Zimbabwe if(lcid ==0x0009 || lcid ==0x0C09 || lcid ==0x2809 || lcid ==0x1009 || lcid == 0x2409|| lcid ==0x1809 || lcid ==0x2009 || lcid ==0x1409 || lcid ==0x3409 ||lcid ==0x1c09 ||lcid ==0x2c09 ||lcid ==0x0809 || lcid ==0x0409 ||lcid ==0x3009) { XXX.English; }