Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue with non-English locales. Fixes #20.

  • Loading branch information...
commit a1c9c2995eb9ecc62aba0eef50ed4b9d4809a1b5 1 parent 824e4ee
@mrjbq7 authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 tracstats/web_ui.py
View
10 tracstats/web_ui.py
@@ -1,6 +1,7 @@
# stdlib imports
import datetime
+import locale
import re
import string
import time
@@ -670,7 +671,14 @@ def _process_code(self, req, cursor, where, data):
'y': y,})
data['byhour'] = stats
- days = dict((day, i) for i, day in enumerate(('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat')))
+ days = dict((day, i) for i, day in
+ enumerate((locale.nl_langinfo(locale.ABDAY_1),
+ locale.nl_langinfo(locale.ABDAY_2),
+ locale.nl_langinfo(locale.ABDAY_3),
+ locale.nl_langinfo(locale.ABDAY_4),
+ locale.nl_langinfo(locale.ABDAY_5),
+ locale.nl_langinfo(locale.ABDAY_6),
+ locale.nl_langinfo(locale.ABDAY_7))))
d = dict((i, 0) for i in range(7))
for rev, t, author, _ in revisions:
day = time.strftime('%a', time.localtime(t))
Please sign in to comment.
Something went wrong with that request. Please try again.