Vishal Chavan
Vishal Chavan

Reputation: 13

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.

Upvotes: 0

Views: 527

Answers (2)

Andrew Truckle
Andrew Truckle

Reputation: 19087

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.

Upvotes: 0

xMRi
xMRi

Reputation: 15355

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.

Upvotes: 3

Related Questions