need help for multi language support. |
Post Reply |
Author | |
jshan
Groupie Joined: 07 December 2007 Status: Offline Points: 63 |
Post Options
Thanks(0)
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.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
in void CMainFrame::ResetCommandBars()
replace
menu.LoadMenu(IDR_SIGNUSDESIGNER_FRAME);
to
XTPResourceManager()->LoadMenu(&menu, IDR_SIGNUSDESIGNER_FRAME);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Also add
AfxOleInit(); in the beginning of CSignusDesignerApp::InitInstance() to prevent crush on close.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
jshan
Groupie Joined: 07 December 2007 Status: Offline Points: 63 |
Post Options
Thanks(0)
|
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.
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
|
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 |
|
jshan
Groupie Joined: 07 December 2007 Status: Offline Points: 63 |
Post Options
Thanks(0)
|
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 ;( ?
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
|
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 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
See code of CommandBars\ScribbleMultiLang\PenDlg.cpp
you need
InitModalIndirect(XTPResourceManager()->LoadDialogTemplate(IDD), pParent);
line.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
jshan
Groupie Joined: 07 December 2007 Status: Offline Points: 63 |
Post Options
Thanks(0)
|
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.
|
|
jshan
Groupie Joined: 07 December 2007 Status: Offline Points: 63 |
Post Options
Thanks(0)
|
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.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |