title: django translation template {% trans "something" %}
body: <p>Ok I have been searching like crazy for this I think simple problem.</p>
  
  <p>I use Django 1.4</p>
  
  <p>The problem is that django won't translate a simple {% trans "work" %} in my template.</p>
  
  <p>This is what I have done:</p>
  
  <p>Settings.py:</p>
  
  <pre><code>LANGUAGE_CODE = 'en-us'
  USE_I18N = True
  MIDDLEWARE_CLASSES = (
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.locale.LocaleMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      # Uncomment the next line for simple clickjacking protection:
      # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  )
  TEMPLATE_CONTEXT_PROCESSORS = (
      "django.contrib.auth.context_processors.auth",
      "django.core.context_processors.debug",
      "django.core.context_processors.i18n",
      "django.core.context_processors.media",
      "django.core.context_processors.static",
      "django.core.context_processors.request",
  )
  
  LOCALE_PATHS = (
      '/home/m00p/PycharmProjects/astrid/locale'
  )
  </code></pre>
  
  <p>this is my map structure:</p>
  
  <pre><code>/
  myproject/
  apps/
  locale/
  template/
  </code></pre>
  
  <p>So I runned  </p>
  
  <blockquote>
    <p>django-admin.py makemessages -l nl -i settings.py</p>
  </blockquote>
  
  <p>and it did succesfully created in the locale folder nl/LC_MESSAGES/django.po, I then edit the translation It found in the django.po </p>
  
  <pre><code>#: templates/base.html:22
  msgid "work"
  msgstr "ddddddddddddd"
  </code></pre>
  
  <p>I then run the compile command</p>
  
  <blockquote>
    <p>django-admin.py compilemessages</p>
  </blockquote>
  
  <p>and it also succesfully created a django.mo file in the correct folder</p>
  
  <p>I added this also in the myproject/urls.py</p>
  
  <pre><code>urlpatterns = patterns('',
      url(r'^i18n/', include('django.conf.urls.i18n')),
  )
  
  urlpatterns += i18n_patterns('',
      url(r'^$', 'front.views.home', name='home'),
  )
  </code></pre>
  
  <p>I added this in the base.html file to be able to change the language</p>
  
  <pre><code>&lt;form action="/i18n/setlang/" method="post"&gt;
      {% csrf_token %}
      &lt;input name="next" type="hidden" value="/" /&gt;
      &lt;select name="language"&gt;
          {% get_language_info_list for LANGUAGES as languages %}
          {% for language in languages %}
              &lt;option value="{{ language.code }}"&gt;{{ language.name_local }} ({{ language.code }})&lt;/option&gt;
          {% endfor %}
      &lt;/select&gt;
      &lt;input type="submit" value="Go" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>So when I go to the website I get 127.0.0.1:8000/en/ in the url, this is correct because englisch is the default language, when I then change it with the form to NL, It redirects to 127.0.0.1:8000/nl/ but the text I translated didn't change. I'm also sure that the language is NL because when I display {{ LANGUAGE_CODE }} it says NL.</p>
  
  <p>Anybody know why it doesn't change?</p>
  
  <p>Thanks m00p</p>
  
  <p><strong>PROBLEM SOLVED</strong></p>
  
  <p>During the process when I was adding things I forgot for it to work, I restarted my deployment server, but I <strong>didn't cleared the cache of my browser</strong> it was still using the old pages, so when I cleared my browser data in Chrome and revisited the page and changed the language it translated it correctly.  Thanks for the suggestions anyway!</p>