Print Page | Close Window

need help for multi language support.

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=10775
Printed Date: 06 June 2024 at 3:18am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: need help for multi language support.
Posted By: jshan
Subject: need help for multi language support.
Date Posted: 26 May 2008 at 12:14am
Hi.
 
I'm making multi language support project.
I've been doing some works for this by referring with Scribble.
But no Luck.
 
I linked my sample projects to figure out the problems.
 
There are two languages enabled, one is Enlgish as default, another is Korean.  As you can see with the sample, When chose Korean, Only System Dialogs are changed to Korean not the CommandBar Menu or the User Dialogs.
 
Any Idea ?
 
thanks in advance.
 
sample projects
 
-- source link removed by me :)
 
 
jshan.
 



Replies:
Posted By: Oleg
Date Posted: 26 May 2008 at 1:19am
Hi,
 
in void CMainFrame::ResetCommandBars()
 
replace
menu.LoadMenu(IDR_SIGNUSDESIGNER_FRAME);
to
XTPResourceManager()->LoadMenu(&menu, IDR_SIGNUSDESIGNER_FRAME);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Oleg
Date Posted: 26 May 2008 at 1:20am
Also add
 
AfxOleInit(); in the beginning of CSignusDesignerApp::InitInstance() to prevent crush on close.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jshan
Date Posted: 26 May 2008 at 3:16am
Great thanks.
 
but How about the dialogs in the tab ?
And also other string resources still not applied.
 
I thought UpdateWindow() will reflect all windows in the frame when changed a language.
 
But it seems, even though patching like you mentioned, except menu, all user defined resources don't change at all.
 
 
 


Posted By: mgampi
Date Posted: 26 May 2008 at 3:52am
Hi;
In our app I send a user defined message to all descendant windows of the main frame to enable reload of the resources. This is not done by UpdateWindow()...
So you have to catch the message and call LoadString(), ... and then refresh the window. 


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: jshan
Date Posted: 26 May 2008 at 4:27am
Originally posted by mgampi mgampi wrote:

Hi;
In our app I send a user defined message to all descendant windows of the main frame to enable reload of the resources. This is not done by UpdateWindow()...
So you have to catch the message and call LoadString(), ... and then refresh the window. 
 
thanks for the input,
 
How about the dialog resources ? I made different dialogs for the languages.  how to reload dialog resources ?
 
I thought, XTPResourceManager read specific language resources and overwrite the existed resource so, I just need refresh the whole windows to reflects new one.  but seems it's not.
Any way to make it like this way ?
 
Reloading whole string resources manually is kind of too much.
I feel there probably easy way.. .
 
No ;( ?
 
 


Posted By: mgampi
Date Posted: 26 May 2008 at 4:36am
Hi;
I didn't find an easier way, but no one is free of errors...
To rebuild dialogs, you have to destroy and recreate them.


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017


Posted By: Oleg
Date Posted: 26 May 2008 at 9:51am
Hi,
 
See code of CommandBars\ScribbleMultiLang\PenDlg.cpp
 
you need
InitModalIndirect(XTPResourceManager()->LoadDialogTemplate(IDD), pParent);
line.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jshan
Date Posted: 26 May 2008 at 9:59am
Hi.
 
I  Added
 
BOOL CxxDlg:CreateDlg(CWnd* pParentWnd)
{
     LPCDLGTEMPLATE lpDialogTemplate = XTPResourceManager()->LoadDialogTemplate(IDD);
     // create a modeless dialog
     BOOL bSuccess = CreateDlgIndirect(lpDialogTemplate, pParentWnd, AfxGetInstanceHandle());
     return bSuccess;
}
 
for modaless Dlg.
 
And made simple macro to get multi-language strings.
much better now.
 
But there is a flickering while recreating Dlgs.
any tips to eliminate the flickerring ? or any other chance to not recreate dlgs ?
 
thanks.
 
jshan.
 


Posted By: jshan
Date Posted: 26 May 2008 at 10:16am

ShowWindow(SW_HIDE);

...
// Recreating Dlgs
...
 
ShowWindow(SW_SHOWNORMAL);
 
===========
 
with this code, flickering is almost gone.
 
Any improvements will be welcomed.
 
very Thanks Oleg and http://forum.codejock.com/member_profile.asp?PF=109&FID=117 - mgampi for helps.
 
jshan.
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net