Opened 10 years ago

Closed 10 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)

0001-using-nl_langinfo-to-localize-date-time-strings.patch (3.0 KB) - added by walter 10 years ago.
patch to add locale info to date/time strings

Download all attachments as: .zip

Change History (4)

comment:1 Changed 10 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 10 years ago by walter

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

Changed 10 years ago by walter

patch to add locale info to date/time strings

comment:3 Changed 10 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.

Note: See TracTickets for help on using tickets.