C # implement multiple languages

Source: Internet
Author: User

1. perform multi-language localization after the project is stable.

2. Pay attention to the following points for language preparation:

2.1 multi-language support for controls (including forms). You can enter winres in the command prompt of vs2008. Set with a visual operation interface

Set locallizable = true for the form.

And select language

2.2 variable multi-language:

(1)CodeDo not use hard encoding.

(2) Use this encoding method: String MSG = properties. Resources. infomsg. Infomsg is set through resources. resx.

Therefore, all operations that require multi-language processing must be set in resources. resx using variables.

(3) InProgramCopy the resources. resx file. Name it resources. en-GB.resx.

3. Add the following statement at the exit of the program:

System. Globalization. cultureinfo uiculture = new system. Globalization. cultureinfo ("En-GB ");

Thread. currentthread. currentuiculture = uiculture;

You can complete multiple programming languages by performing the preceding steps.

 

Note: After multi-language processing, the corresponding multi-language folder will appear in the bin directory of the program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.