Skip to content

Commit

Permalink
Make TranslatableSettings work for date formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Oct 30, 2015
1 parent 099b122 commit 5fcacbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nikola/utils.py
Expand Up @@ -1196,6 +1196,9 @@ def formatted_date(self, date_format, date):
# For thread-safety
self.__set_locale(current_lang)
fmt_date = None
# Get a string out of a TranslatableSetting
if isinstance(date_format, TranslatableSetting):
date_format = date_format(current_lang)
# First check handlers
for handler in self.formatted_date_handlers:
fmt_date = handler(date_format, date, current_lang)
Expand Down

0 comments on commit 5fcacbd

Please sign in to comment.