Professional UI Solutions
Site Map   /  Register


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 General Discussion » Language Switcher sample and ResetLocalizedResources Collapse All
Subject Author Date
Therese P Feb 24, 2011 - 2:06 PM

Hi, 2 questions.

First on the Language Switcher sample, when I enable the Custom Language and select French (canada) - including resources of this sample, only the toolbars and dialogs that are called have switched to French. Shoudn’t IDD_DIALOG_CHILD_VIEW change too?

This leads to the second question. Here is the simplified version of what we have. A view that has buttonA and buttonB, when buttonA is pressed MenuA appears (IDR_MENU_A which we have in English and in Korean) and same idea for buttonB with MenuB (IDR_MENU_B). Let’s say we start the application in Korean and we click on buttonA, MenuA appears in Korean as it should. We purposely do NOT click on buttonB. Now we switch to English language (our process closes all opened views and reloads them). The view with the 2 buttons is reloaded in English. We then click on buttonA: MenuA stayed in Korean. We click on buttonB, MenuB appears in English correctly. In debug, it goes through the else as it should and loadMenuEx the English version of the menu but it displays Korean:

if (ForeignLang()) { g_ResourceManager->LoadMenuEx( l_oMenu, IDR_MENU_A, KOREAN_LANG_ID ); } 
else {  g_ResourceManager->LoadMenuEx( l_oMenu, IDR_MENU_A, ENGLISH_LANG_ID ); } 

We implemented the following but we are missing something we cant put our finger on.

   CExtControlBar::stat_RecalcBarMetrics( this ); 
   CExtControlBar::stat_RedrawFloatingFrames( this ); 

We dont understand why it is only the IDR_MENU’s that do not load correclty while the views, dialogs, buttons etc do. Something to specify too, our application uses several DLLs in which are our resources.

Thanks in advance

Technical Support Feb 27, 2011 - 11:38 PM

The dialog windows should be re-created. Windows supports different dialog template resources for different localized versions of each dialog. Localized dialog templates may have different locations of same controls, different Z-order of controls and even a different number of controls. So, in order to localize your dialogs on-the-fly, you should recreate them.