Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Ribbon not locale-aware! :(
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Ribbon not locale-aware! :(

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Ribbon not locale-aware! :(
    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/
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: 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
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: 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
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: 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
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: 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
Back to Top
Didi View Drop Down
Groupie
Groupie


Joined: 05 July 2013
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote Didi Quote  Post ReplyReply Direct Link To This Post 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

 

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.