Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » Ctrl responds to Language-Setting event?
Re: Ctrl responds to Language-Setting event? [message #35830 is a reply to message #35828] Tue, 27 March 2012 07:22 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Lance Smile
Lance wrote on Tue, 27 March 2012 01:35


If I change language, the main menu reflects it immediately. Not other Ctrl-derivatives. Only Ctrls created afterwards will reflect the change in language setting. Is it a way to make Ctrls responds to change in language setting? For example, it is possible to defer language-translation to Paint() so that a call to Refresh() will do?

I was fighting the very same thing few weeks ago and the solution that seemed most elegant to me is this: For each GUI class I created a method Setup() which handled all the language dependent stuff - the layout initialization (CtrlLayout call) and all the code that used t_("") macro to assign translated strings to my Ctrls. If you call such function in constructor and also each time after the language changes, the labels will be translated correctly. The biggest problem I had was with GridCtrl, where I had to recreate all the contents because it contained some translated strings as well Smile.
Lance wrote on Tue, 27 March 2012 01:35

Another problem I encountered with changing language setting is with EditDate. Due to date scan format changing, it will not Accept() the date string it previously displayed.

I think simple workaround for this could be reading out the value to Date variable and assigning it back again after the change. Not tested, but should work Smile

In past I have also used slightly different approach, where I serialized the entire state of the application and then completely restarted the GUI. But that was way to crude, inefficient and involved a pointer Smile ... and on top of that it can't be done simply for every application.

Best regards,
Honza
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help for Indian Language Unicode display
Next Topic: How can I translate the controls for my app?
Goto Forum:
  


Current Time: Fri May 10 21:17:03 CEST 2024

Total time taken to generate the page: 0.02280 seconds