diff --git a/pelican/contents.py b/pelican/contents.py index d61d3710..bdf3c9f0 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -5,6 +5,7 @@ from pelican.settings import _DEFAULT_CONFIG from datetime import datetime from os import getenv from sys import platform, stdin +import locale class Page(object): """Represents a page @@ -85,6 +86,10 @@ class Page(object): else: self.date_format = settings['DEFAULT_DATE_FORMAT'] + if isinstance(self.date_format, tuple): + locale.setlocale(locale.LC_ALL, self.date_format[0]) + self.date_format = self.date_format[1] + if hasattr(self, 'date'): if platform == 'win32': self.locale_date = self.date.strftime(self.date_format.encode('ascii','xmlcharrefreplace')).decode(stdin.encoding)