1024programmer Asp.Net Problems with software internationalization: C# gets the language version of the current windows system

Problems with software internationalization: C# gets the language version of the current windows system

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;
             }

Microsoft��Home Language Code Table – Language Locale ID LCID Correspondence Table

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/problems-with-software-internationalization-c-gets-the-language-version-of-the-current-windows-system/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索