- switch ( actualType )
- {
- case wxDAY:
- if ( (day_of_week < 1) || (day_of_week > 7) )
- strcpy(buf, _("invalid day"));
- else
- strncpy( buf, _(dayname[day_of_week-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- return wxString(buf);
-
- case wxMONTH:
- if ( (month < 1) || (month > 12) )
- strcpy(buf, _("invalid month"));
- else
- strncpy( buf, _(mname[month-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- return wxString(buf);
-
- case wxFULL:
- if ( (month < 1) || (month > 12) || (day_of_week < 0) ||
- (day_of_week > 7) )
- {
- strcpy(buf, _("invalid date"));
- return wxString(buf);
- }
- strncpy( buf, _(dayname[day_of_week-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- strcat( buf, ", ");
- strncat( buf, _(mname[month-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- strcat( buf, " ");
- sprintf( buf+strlen(buf), "%d, %d", day, abs(year) );
- if (year < 0)
- strcat(buf,_(" B.C."));
- return wxString(buf);
-
- case wxEUROPEAN:
- if ( (month < 1) || (month > 12) || (day_of_week < 0) ||
- (day_of_week > 7) )
- {
- strcpy(buf, _("invalid date"));
- return wxString(buf);
- }
- sprintf(buf,"%d ", day);
- strncat(buf, _(mname[month-1]),
- (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- sprintf( buf+strlen(buf), " %d", abs(year) );
- if (year < 0)
- strcat(buf, _(" B.C."));
- return wxString(buf);
-
- case wxMDY:
- default:
- if (day==0 || month==0 || year==0)
- strcpy(buf, _("invalid date"));
- else
- sprintf( buf+strlen(buf), "%1d/%1d/%02d", month, day,
- (DisplayOptions & wxNO_CENTURY) && (abs(year) > 1899)
- ? (abs(year) - (abs(year) / 100 * 100))
- : (abs(year)) );
- return wxString(buf);
- }
- return wxString("");
+ switch ( actualType )
+ {
+ case wxDAY:
+ if ( (day_of_week < 1) || (day_of_week > 7) )
+ wxStrcpy(buf, _("invalid day"));
+ else
+ wxStrncpy( buf, wxGetTranslation(dayname[day_of_week-1]),
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ return wxString(buf);
+
+ case wxMONTH:
+ if ( (month < 1) || (month > 12) )
+ wxStrcpy(buf, _("invalid month"));
+ else
+ wxStrncpy( buf, wxGetTranslation(mname[month-1]),
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ return wxString(buf);
+
+ case wxFULL:
+ if ( (month < 1) || (month > 12) || (day_of_week < 0) ||
+ (day_of_week > 7) )
+ {
+ wxStrcpy(buf, _("invalid date"));
+ return wxString(buf);
+ }
+ wxStrncpy( buf, wxGetTranslation(dayname[day_of_week-1]),
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ wxStrcat( buf, wxT(", "));
+ wxStrncat( buf, wxGetTranslation(mname[month-1]),
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ wxStrcat( buf, wxT(" "));
+ wxSprintf( buf+wxStrlen(buf), wxT("%d, %d"), day, abs(year) );
+ if (year < 0)
+ wxStrcat(buf,_(" B.C."));
+ return wxString(buf);
+
+ case wxEUROPEAN:
+ if ( (month < 1) || (month > 12) || (day_of_week < 0) ||
+ (day_of_week > 7) )
+ {
+ wxStrcpy(buf, _("invalid date"));
+ return wxString(buf);
+ }
+ wxSprintf(buf,wxT("%d "), day);
+ wxStrncat(buf, wxGetTranslation(mname[month-1]),
+ (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
+ wxSprintf( buf+wxStrlen(buf), wxT(" %d"), abs(year) );
+ if (year < 0)
+ wxStrcat(buf, _(" B.C."));
+ return wxString(buf);
+
+ case wxMDY:
+ default:
+ if (day==0 || month==0 || year==0)
+ wxStrcpy(buf, _("invalid date"));
+ else
+ wxSprintf( buf+wxStrlen(buf), wxT("%1d/%1d/%02d"), month, day,
+ (DisplayOptions & wxNO_CENTURY) && (abs(year) > 1899)
+ ? (abs(year) - (abs(year) / 100 * 100))
+ : (abs(year)) );
+ return wxString(buf);
+ }
+ return wxString(wxT(""));