Changing weekday names in CalendarCtrl

Robin Dunn wrote:

The wx message catalog files (gettext) translation files are in CVS at http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/locale/ but I don't see strings for the weekday names there. A closer look at wxCalendarCtrl shows that it is using wxDateTime::GetWeekDayName to get the strings, and it is using standard C library routines to get the weekday name, wich will use the current locale settings to determine which strings to return. So it appears that there isn't any way to change it other than changing the wxDateTime code.

Just out of curiosity, do you get the same string values from this Python code?:

>>> import time
>>> t = time.localtime()
>>> time.strftime("%a", t)

Is there any other format string that will return the abbreviated weekday names that you are looking for?

>>> L = wx.Locale()
>>> L.Init(wx.LANGUAGE_CHINESE_SIMPLIFIED)
>>> time.strftime("%A", t) == time.strftime("%a", t)
True

So it seems there is no abbreviated form for weekdays names, which is quite surprising. Nothing in the strftime documentation points to any other hopeful format strings.

Is there any way out of this? Maybe putting these translations into the translation files would be better.

···

--
HONG Yuan
Homemaster Trading Co., Ltd.
No. 601, Bldg. 41, 288 Shuangyang Rd. (N)
Shanghai 200433, P.R.C.
Tel: +86 21 55056553
Fax: +86 21 55067325
E-mail: hongyuan@homemaster.cn

Hong Yuan wrote:

Robin Dunn wrote:

The wx message catalog files (gettext) translation files are in CVS at http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/locale/ but I don't see strings for the weekday names there. A closer look at wxCalendarCtrl shows that it is using wxDateTime::GetWeekDayName to get the strings, and it is using standard C library routines to get the weekday name, wich will use the current locale settings to determine which strings to return. So it appears that there isn't any way to change it other than changing the wxDateTime code.

Just out of curiosity, do you get the same string values from this Python code?:

>>> import time
>>> t = time.localtime()
>>> time.strftime("%a", t)

Is there any other format string that will return the abbreviated weekday names that you are looking for?

>>> L = wx.Locale()
>>> L.Init(wx.LANGUAGE_CHINESE_SIMPLIFIED)
>>> time.strftime("%A", t) == time.strftime("%a", t)
True

So it seems there is no abbreviated form for weekdays names, which is quite surprising. Nothing in the strftime documentation points to any other hopeful format strings.

Is there any way out of this? Maybe putting these translations into the translation files would be better.

Create a bug report that explains the situation and why strftime("%a") doesn't work for that locale. Perhaps

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!