Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - need help for multi language support.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

need help for multi language support.

 Post Reply Post Reply
Author
Message
jshan View Drop Down
Groupie
Groupie
Avatar

Joined: 07 December 2007
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote jshan Quote  Post ReplyReply Direct Link To This Post Topic: need help for multi language support.
    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.
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jshan View Drop Down
Groupie
Groupie
Avatar

Joined: 07 December 2007
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote jshan Quote  Post ReplyReply Direct Link To This Post 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.
 
 
 
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jshan View Drop Down
Groupie
Groupie
Avatar

Joined: 07 December 2007
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote jshan Quote  Post ReplyReply Direct Link To This Post 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 ;( ?
 
 
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jshan View Drop Down
Groupie
Groupie
Avatar

Joined: 07 December 2007
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote jshan Quote  Post ReplyReply Direct Link To This Post 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.
 
Back to Top
jshan View Drop Down
Groupie
Groupie
Avatar

Joined: 07 December 2007
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote jshan Quote  Post ReplyReply Direct Link To This Post 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 mgampi for helps.
 
jshan.
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.