简体   繁体   中英

Pick appropriate .rc file on language selection

In my MFC application,there are three resource files(.rc) for three different languages(jap,eng,russian) and one main.rc file which includes other three resource file.All resource files contains same resource string in different languages and they all includes same resource header resource.h. When user runs the application ,popup window will appear asking user to select one language.Based on the user selection application has to select appropriate rc from which it will load resources.

Is there any way by which when user select one language application will pick appropriate resource file.

In the MFC this is done via satellite DLLs.

Place each language RC in a separate DLL. Than upon load of the application load the specific language DLL and use AfxSetResourceHandle with this handle.

In this case resource are searched in this DLL.

An alternative is to consider adding additional stringtables to your project.

More details are provided here:

http://www.dev102.com/2008/10/20/how-to-localize-your-application-using-string-tables/

Basically, you add an additional table and set the culture information in the resource editor. Then, you can specify that culture before getting the value.

The example provided is for C# but the principles are just the same.

A possible way forward if needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM