Print Page | Close Window

Ribbon not locale-aware! :(

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=17344
Printed Date: 17 June 2025 at 10:45pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Ribbon not locale-aware! :(
Posted By: znakeeye
Subject: Ribbon not locale-aware! :(
Date Posted: 28 September 2010 at 4:46pm
XTP 13.4.1.
 
Ribbon does not use XTPResourceManager() for captions etc. Every ribbon-function that accepts a resource-ID uses CString::LoadString... Why?
 
Now I can't localize ribbon like the commandbars are localized in Scribble sample Cry


-------------
PokerMemento - http://www.pokermemento.com/



Replies:
Posted By: Oleg
Date Posted: 29 September 2010 at 1:15am
Hi,

XTPResourceManager() is used only for strings that are part of Toolkit resources - dialogs/string/etc.

CString::LoadString - is used for application defined resources - promts/catptions.  

If you have localized dll add AfxSetResourceHandle to switch it.


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


Posted By: znakeeye
Date Posted: 29 September 2010 at 4:48am
Yes, but your scribble-sample makes use of xml-files for localization. Very neat!
 
Are you saying that localization of ribbon captions can be done simply by setting the locale using the same logic as in your Scribble sample? E.g. setlocale() and SetThreadLocale()?
 
 
Actually, it would be great if you added the Scribble-localization stuff to your Ribbon sample. If it works out of the box, then show it! It's a good sales point :)


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: znakeeye
Date Posted: 29 September 2010 at 5:14pm
Got most of it working, but I do have two questions:
 
1) What is the best way to reload the ribbon captions/tooltips after setting locale?
2) What does CompactMode="1" in the xml mean?
 
Many thanks!


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 30 September 2010 at 6:21am
Hi,

1. Best way is to use Actions for Controls.  Check Actions sample - you can load german/english translation and all captions will be changed automatically.

2. was added for back compatibility for old XML propExchange. just always use 1 :)


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


Posted By: znakeeye
Date Posted: 30 September 2010 at 6:36am
Cool. Are actions applied for tooltips too?
 
I suppose that to update whole application after language change, the following must be done:
1) Ribbon = nothing, thanks to actions.
2) Panes = explicit update of captions.
3) Pane dialogs = not sure. Dialog must be recreated?
4) Report controls = explicit update of columns/group row headers (and possibly tooltips).
 
Correct?


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: znakeeye
Date Posted: 01 October 2010 at 11:45am
pCommandBars->EnableActions();
 
GetActions()->Add(ID_RIBBON_ITEM1);
...
GetActions()->Add(ID_RIBBON_ITEMN);
 
That does not help! :(


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: znakeeye
Date Posted: 02 October 2010 at 9:42am
Originally posted by oleg oleg wrote:

Hi,

XTPResourceManager() is used only for strings that are part of Toolkit resources - dialogs/string/etc.

CString::LoadString - is used for application defined resources - promts/catptions.  

If you have localized dll add AfxSetResourceHandle to switch it.
 
For XML-language files this simply cannot be true. LoadString() keeps returning the English string, whereas XTPResourceManager()->LoadString() does indeed return the localized string. So my question remains... :(


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 04 October 2010 at 2:44am
Hi,

You call EnableActions and then should load all actions from XML. Review ActionsSample's Load/save methods.


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


Posted By: znakeeye
Date Posted: 04 October 2010 at 6:18am
Thanks. Will give it another shot. I obviously loaded the xml before calling EnableActions(). However, I still need help with a couple of questions.
 
1) How do you reload the dialog template of a property page (non-modal = always visible)?
2) AddGroup/AddTab do not make use of XTPResourceManager(). Are you sure this is not a bug? Adding controls works as expected. As it is now, I have to call SetCaption(lpszCaption) with my localized string - retrieved from XTPResourceManager()...


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 04 October 2010 at 8:22am

1. Think with dialog you can only destroy and create it.  Most applications just ask user restart application when user change language of GUI.

2. Yes, its not bug. If you have common Resources for Toolkit and application you indeed can manually call SetCaption.


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


Posted By: Didi
Date Posted: 19 November 2013 at 4:25am

Hi,

how can I change the built-in parts of the ribbon?  Ie. the  Tooltip:  “Customize Quick Acess Toolbar”, or its menu-members like: “&More Commands…”,”&Show Below the Ribbon” or “Mi&nimize the Ribbon”?

Thank you

 




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