![]() |
need help for multi language support. |
Post Reply
|
| Author | |
jshan
Groupie
Joined: 07 December 2007 Status: Offline Points: 63 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
jshan
Groupie
Joined: 07 December 2007 Status: Offline Points: 63 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
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 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
jshan
Groupie
Joined: 07 December 2007 Status: Offline Points: 63 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 May 2008 at 4:27am |
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: 1210 |
Post Options
Thanks(0)
Quote Reply
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 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
jshan
Groupie
Joined: 07 December 2007 Status: Offline Points: 63 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
jshan
Groupie
Joined: 07 December 2007 Status: Offline Points: 63 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
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 |