VC in a project to achieve multi-language version

Source: Internet
Author: User
Tags resource

Some time ago because I do a program, customer requirements to have the Chinese and English version, began to think to do two projects, but the resource file is different, but found such a project to update another one also want to update, it is very troublesome, and then through the Internet to find information and personal experiments, found in fact, as long as in a project can be achieved But there are two resource files in this project, and when compiling different versions, the program can automatically link to different resource files. Here is a concrete way to write it out. For your reference.

First step, create the Chinese and English version of the resource file

We first create the first Chinese version of the project, assuming the project name is Example, in the first step of the wizard, "What language would you want to resource in" select Chinese (The following image), other use the default values.

Then in the project to remove the example.rc, although this deletion of the file, but in fact, in the engineering file directory files still exist. Enter the project directory to change the resource file name to Example_ch.rc, and then add the Example_ch.rc file in the VC compiler, close the project.

Then create an English version of the project with the same name. That is, choose English when choosing a resource language (you can save it in a different directory)

After the creation, the English version of the directory to copy the Example.rc file to the Chinese project directory, in fact, we just want this resource file. and changed the name to Example_en.rc.

Step two, set the version information in the project

Open the file project, the English resource file added to the project, in addition, there will be prompts to appear, do not ignore, according to confirm on the line.

Select Menu Build->configurations, add an engineering configuration, enter debug 中文版 in configuration to select Debug in Copy Setting from (see figure below), use the same method, Add a debug Chinese configuration and remove the original debug.

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.