Make date formatting locale-aware (bug 663)

This commit is contained in:
Vladimir Voroshilov 2010-09-26 23:42:05 +02:00 committed by Thomas Perl
parent 80d9fd7d9b
commit 54cf803159
1 changed files with 4 additions and 1 deletions

View File

@ -65,6 +65,9 @@ _ = gpodder.gettext
N_ = gpodder.ngettext
import locale
locale.setlocale(locale.LC_ALL, '')
# Native filesystem encoding detection
encoding = sys.getfilesystemencoding()
@ -433,7 +436,7 @@ def format_date(timestamp):
if diff < 7:
# Weekday name
return str(timestamp.strftime('%A'))
return str(timestamp.strftime('%A').decode(encoding))
else:
# Locale's appropriate date representation
return str(timestamp.strftime('%x'))