Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Multi-language support for dialog-based system? Collapse All
Subject Author Date
Bangjun Lei Oct 14, 2007 - 7:23 AM

Dear Sir./Madam.,

I want to add language switch into my dialog system that also has a menu (in the form of menubar) associated with it. Could you instruct me how to do this? The LanguageSwitch sample is based on SDI application and a bit difficult to figure out what should I do for dialog-based systems.

Thanks!

Technical Support Oct 15, 2007 - 1:48 PM

In Prof-UIS uses there is a CExtResourceManager class (that is accessible via the g_ResourceManager global smart pointer variable) and this class is used for loading resources of any type instead using Win32 APIs and methods of MFC classes. This makes possible to specify the preferred language identifier for loading resources using the following code:

g_ResourceManager->AllowCustomLang( true );
g_ResourceManager->SetLangIdDesired( nLangID );
with nLangID set to one of the __EXT_MFC_LANG_ID_*** constants defined in the ../Prof-UIS/Include/ExtCmdManager.h file. After invoking the code lines above, all the resource loading invocations will be searching for and loading the resources of the specified language. That means you should re-initialize the entire UI in your application: re-load toolbars, menus, cached string variables and re-create dialogs. To re-create dialogs is essential because dialog template resources can be different for different languages.