Ribbon not locale-aware! :( |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
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
|
|
PokerMemento - http://www.pokermemento.com/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
pCommandBars->EnableActions();
GetActions()->Add(ID_RIBBON_ITEM1);
...
GetActions()->Add(ID_RIBBON_ITEMN);
That does not help! :( |
|
PokerMemento - http://www.pokermemento.com/
|
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
You call EnableActions and then should load all actions from XML. Review ActionsSample's Load/save methods.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
Didi
Groupie Joined: 05 July 2013 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
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
|
|
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 |