wxdatetime and monthame language Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
armink
Experienced Solver
Experienced Solver
Posts: 79
Joined: Tue Aug 31, 2004 10:25 am
Location: Bavaria / Germany

wxdatetime and monthame language

Post by armink »

Hello,

I'm working on a german computer and use wxdatetime to get the month name.

The problem is I
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

Did you try to set the wxLocale to English?

it may works on some items (widgets, messages, UI strings), but not for others, like the calendar control, which is system dependant... therefore, it will use the system language...
armink
Experienced Solver
Experienced Solver
Posts: 79
Joined: Tue Aug 31, 2004 10:25 am
Location: Bavaria / Germany

Post by armink »

All my application messages are in english since some colleages are from UK and US. For the german ones I set in OnInit() a translation catalog

Code: Select all

...
int syslang = wxLocale::GetSystemLanguage();
    
    switch ( syslang )
    {
        case wxLANGUAGE_GERMAN:
        m_locale.Init(wxLANGUAGE_GERMAN);
        m_locale.AddCatalog(wxT("de_catalog.mo"));
        break;
                
        default:
        ;
    }

...


You mean I could temporarily set the locale to english ?
I wouldn like to recall all the code above after that ... isnt there a possibility to set the locale just and only for the wxdatetime ?
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

I don't think you can restrict a wxlocale for a widget, as this is a global setting for the app.
armink
Experienced Solver
Experienced Solver
Posts: 79
Joined: Tue Aug 31, 2004 10:25 am
Location: Bavaria / Germany

Post by armink »

well ... I solved the problem now with

Code: Select all

...
monthname=dt.GetMonthName(dt.GetCurrentMonth());
        			monthname.Replace("Januar","January");
        			monthname.Replace("Februar","February");
        			monthname.Replace("M
Post Reply