title: django - how to make translation work?
body: <p>I'm trying to render a template in a different language using i18n. I did everything I could read about, from setting the language code, creating and compiling translation files, including the translation tags in the template and all that, and my template still renders in English, even through the {{ LANGUAGE_CODE }} variable points to the correct (and different) code I intended to render. What am I missing?</p>
  
  <p>template:</p>
  
  <pre><code>{% extends "base.html" %}
  {% load i18n %}
  {% get_current_language as LANGUAGE_CODE %}
  {% get_available_languages as LANGUAGES %}
  {% get_current_language_bidi as LANGUAGE_BIDI %}
  {% block title %}{% trans "translation test" %}{% endblock %}
  {% block content %}
  &lt;div id="some-text"&gt;
    {% trans "some translated text goes here" %}
    {% blocktrans %}
    &lt;ol&gt;
      &lt;li&gt;here are some&lt;/li&gt;
      &lt;li&gt;items that should be&lt;/li&gt;
      &lt;li&gt;translated as well&lt;/li&gt;
    &lt;/ol&gt;
    {% endblocktrans %}
    &lt;ul&gt;
        &lt;li&gt;The current language is &lt;b&gt;{{ LANGUAGE_CODE }}&lt;/b&gt;&lt;/li&gt;
        {% if LANGUAGE_BIDI %}
          &lt;li&gt;The current language is bidirectional&lt;/li&gt;
        {% else %}
          &lt;li&gt;The current language is &lt;b&gt;not&lt;/b&gt; bidirectional&lt;/li&gt;
        {% endif %}
        &lt;li&gt;Available languages are:
          &lt;ul&gt;
          {% for lang in LANGUAGES %}
            &lt;li&gt;{{ lang.1}}&lt;/li&gt;
          {% endfor %}
          &lt;/ul&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>view:</p>
  
  <pre><code>from django.shortcuts import render_to_response
  from django.template import RequestContext
  from pdb import set_trace as debugger
  def check(request):
      return render_to_response('index.html', context_instance=RequestContext(request)
  </code></pre>
  
  <p>command line (I did fill in the correct translations in .po files):</p>
  
  <pre><code>$ django-admin.py makemessages -l he-il -e html
  $ django-admin.py compilemessages
  </code></pre>
  
  <p>settings.py:</p>
  
  <pre><code># Language code for this installation. All choices can be found here:
  # http://www.i18nguy.com/unicode/language-identifiers.html
  LANGUAGE_CODE = 'he-il'
  
  gettext = lambda s: s
  LANGUAGES = (
      ('he-il', gettext('Hebrew')),
      ('en-us', gettext('English')),
  )
  
  # If you set this to False, Django will make some optimizations so as not
  # to load the internationalization machinery.
  USE_I18N = True
  
  TEMPLATE_CONTEXT_PROCESSORS = (
      "django.core.context_processors.auth",
      "django.core.context_processors.i18n",
  )
  
  MIDDLEWARE_CLASSES = (
      'django.middleware.common.CommonMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.locale.LocaleMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
  )
  </code></pre>