Hi,
I want to translate my application. I thought I use wxLocale and add my catalog. In the main dialog it works perfectly, but in the children of the dialog all strings are in default english. Have I to add wxLocale (and the catalogs) to every subwindow in my program or is it possible to do this in a global way?
Thank you very much,
Morfio
Localize application - wxLocale in every Frame and Dialog
-
- wxWorld Domination!
- Posts: 1471
- Joined: Tue Nov 14, 2006 7:58 am
- Location: Saint-Petersburg, Russia
Re: Localize application - wxLocale in every Frame and Dialo
Hi,
Anything like this:
usually it becomes on wxApp level. OnOnit method is the best place for it.Morfio wrote:Hi,
I want to translate my application. I thought I use wxLocale and add my catalog. In the main dialog it works perfectly, but in the children of the dialog all strings are in default english. Have I to add wxLocale (and the catalogs) to every subwindow in my program or is it possible to do this in a global way?
Anything like this:
Code: Select all
bool MyApp::OnInit()
{
// Some Init
...
// Set locale
int sys_lang = wxLocale::GetSystemLanguage();
if( sys_lang != wxLANGUAGE_DEFAULT )
{
m_locale.Init(sys_lang); // set custom locale
m_locale.AddCatalogLookupPathPrefix("locale"); // set "locale" prefix
m_locale.AddCatalog("maycatalog"); // our private domain
m_locale.AddCatalog("wxstd"); // wx common domain is default
...
}
...
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10