Opened 12 years ago
Closed 12 years ago
#2538 closed defect (duplicate)
Moon does not localize date/time strings
Reported by: | walter | Owned by: | garycmartin |
---|---|---|---|
Priority: | Unspecified by Maintainer | Milestone: | Unspecified |
Component: | Moon | Version: | Git as of bugdate |
Severity: | Unspecified | Keywords: | |
Cc: | Distribution/OS: | Unspecified | |
Bug Status: | Unconfirmed |
Description
In the display of the various 'Next' string, locale is not taken into consideration when displaying ctime. Thus the day and month abbreviated names are in English, despite the locale setting.
We need to replace the called to ctime with a call strftime
locale.nl_langinfo(locale.D_T_FMT) returns the formatting information you need.
I've not quite figured out the proper syntax for putting it all together.
Attachments (1)
Change History (4)
comment:1 Changed 12 years ago by walter
- Component changed from untriaged to Moon
- Owner set to garycmartin
- Version changed from Unspecified to Git as of bugdate
comment:2 Changed 12 years ago by walter
comment:3 Changed 12 years ago by garycmartin
- Resolution set to duplicate
- Status changed from new to closed
Sorry, just go to your patch but pretty sure this (original ticket #191) is now fixed in git by: http://git.sugarlabs.org/moon/mainline/commit/de6605cdf3b4638c57600813233872a61f959d7e
Tested date translations for English, Spanish, and French.
time.strftime(locale.nl_langinfo(locale.D_T_FMT),time.localtime(t)) seems to do the right thing, where t is the time in seconds currently being passed to time.ctime