Skip to content

Commit

Permalink
Install the gettext callables
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Nov 27, 2011
1 parent 9844c4b commit 90b48da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion generate
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

import os
import hashlib
from gettext import gettext, ngettext

from django.utils.encoding import smart_str
from jinja2 import Environment, FileSystemLoader

def md5_filter(value):
return hashlib.md5(value).hexdigest()

env = Environment(loader=FileSystemLoader('templates'))
env = Environment(loader=FileSystemLoader('templates'),
extensions=['jinja2.ext.i18n'])
env.filters["md5"] = md5_filter
env.install_gettext_callables(gettext, ngettext)

templates = [
"index.html",
Expand Down

0 comments on commit 90b48da

Please sign in to comment.