Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Changing the language at runtime with wxLocale

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Changing the language at runtime with wxLocale
#3707
Posted by: 2004-04-03 00:01:18
Hi,

I'm using the wxLocale class to translate my program and it's working if I fix the language at the startup.

Now I want to be able to switch to another language during the runtime. I really don't see where to start and even if it's possible. Actually I need to restart my app to apply the language change.

Any help is welcome ...

Steph

Message2. Re: Changing the language at runtime with wxLocale
#3714
Posted by: upCASE 2004-04-03 18:02:45
Hi!
Well, I guess this is the most common way to do it. Display a dialog letting the user choose what language to use and then save this setting for later use.
You can actually change the language at runtime, but it's not that easy. You'll have to reinit wxLocale and then delete all the parts that need to be translated like a menu etc. Afterwards, recreate them and the correct language will be used. As I said: Not easy, not very nice. I'd recommend using the "choice->save->restart" way.
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: Changing the language at runtime with wxLocale
#3715
Posted by: 2004-04-03 22:32:41
Until there is a smart way to change the language at runtime I'll do as you recommend : "choice->save->restart"

Thanks for your help.
Steph
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥860.00 ·
 
 
¥900.00 ·
 
 
¥810.00 ·
 
 
¥317.00 ·
 
 
¥1,370.00 ·
 
 
¥660.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0