Ticket #2538 (closed defect: duplicate)

Opened 2 years ago

Last modified 2 years ago

Moon does not localize date/time strings

Reported by: walter Owned by: garycmartin
Priority: Unspecified by Maintainer Milestone: Unspecified by Release Team
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

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

Change History

Changed 2 years ago by walter

  • owner set to garycmartin
  • version changed from Unspecified to Git as of bugdate
  • component changed from untriaged to Moon

Changed 2 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 2 years ago by walter

patch to add locale info to date/time strings

Changed 2 years ago by garycmartin

  • status changed from new to closed
  • resolution set to duplicate

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.