Create two sets of resources in VC to solve the problem of release in Chinese and English versions

Source: Internet
Author: User

Original http://blog.csdn.net/ylforever/article/details/6745611

I. background

When the software needs to release multiple different language versions, there are different requirements on the resource editing menus, buttons, and dialog box size and shapes. For example, if the length of a word is different between Chinese and English characters, the button size is different if the word is used as the button title. At this time, there are two solutions: 1. dynamically adjust the button size through the code, which is troublesome and destroys the WYSIWYG rules of VC resource editing. 2. Prepare two sets of resources and use different resources to compile different versions. The following describes the detailed steps for the second method.

 

2. Steps (take creating resources of both English and Chinese versions as an example)

1) The English version is created by default to complete resource editing. There is an RC file in the project directory, which is an RC file in English version by default.

 

2) copy the file as a Chinese RC file.

 

3. Add resources to the VC project and select vcreszh. RC as follows.

You can have two sets of resources in the resource view.

 

4. Add the compilation option to select the English/Chinese version for compiling. Create a new debugzh in configuration management to compile the Chinese version.

 

5. Set the attributes of the RC file and link different resources under different compilation options.

Vcres. RC is excluded when debugzh is compiled; vcreszh. RC is excluded when debug is compiled. As a result, you can compile different versions by selecting different switches.

 

3. Note

You need to modify the resources in two copies at the same time. Otherwise, the core issue may occur.

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.