title: Django+Jinja2+i18n: jinja2.exceptions.UndefinedError: 'gettext' is undefined
body: <p>I'm trying since many hours to get things work, but still without success. I use Jinja2 with Django (<a href="https://docs.djangoproject.com/en/1.11/topics/templates/#django.template.backends.jinja2.Jinja2" rel="nofollow noreferrer">https://docs.djangoproject.com/en/1.11/topics/templates/#django.template.backends.jinja2.Jinja2</a>) and now I try to enable translations. Jinja2 docs suggest (<a href="http://jinja.pocoo.org/docs/2.9/extensions/#i18n-extension" rel="nofollow noreferrer">http://jinja.pocoo.org/docs/2.9/extensions/#i18n-extension</a>) existing extension (jinja2.ext.i18n). So my configuration looks like this:</p>
  
  <p>settings.py</p>
  
  <pre><code>TEMPLATES = [
  {
      "BACKEND": "django.template.backends.jinja2.Jinja2",
      "DIRS": [os.path.join(BASE_DIR, 'templates')],
      "APP_DIRS": False,
      'OPTIONS' : {
          'environment': 'config.jinja2.environment'
      }
  }]
  </code></pre>
  
  <p>jinja2.py:</p>
  
  <pre><code>def environment(**options):
      env = Environment(**options, extensions=['jinja2.ext.i18n'])
      env.globals.update({
          'static': staticfiles_storage.url,
          'url': reverse,
          'dj': defaultfilters
      })
      return env
  </code></pre>
  
  <p>within template:</p>
  
  <pre><code>{{ gettext('...') }}
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>jinja2.exceptions.UndefinedError: 'gettext' is undefined
  </code></pre>
  
  <p>Does anyone know what the problem is and what I miss? thanks for help in advance!</p>