title: Django JavaScript translation not working
body: <p>I tried to <a href="https://docs.djangoproject.com/en/1.5/topics/i18n/translation/#internationalization-in-javascript-code">follow the guide</a> but it's not clear enough.</p>
  
  <ol>
  <li><p>I added this to my urls.py</p>
  
  <pre><code>urlpatterns = patterns('',
      (r'^jsi18n/(?P&lt;packages&gt;\S+?)/$', 'django.views.i18n.javascript_catalog'),
  )
  </code></pre></li>
  <li><p>Generated the lang files using this command:</p>
  
  <pre><code>django-admin.py makemessages -d djangojs -l fr
  </code></pre></li>
  </ol>
  
  <p><code>root_folder/locale/fr/LC_MESSAGES</code> now contain <code>django.po</code> &amp; <code>djangojs.po</code> and <code>alert(gettext('this is to be translated'));</code> in one of my js files was picked up in <code>djangojs.po</code>.</p>
  
  <ol>
  <li><p>I ran <code>django-admin.py compilemessages</code> and restarted the server.</p></li>
  <li><p>Added this to my base.html:</p>
  
  <pre><code>&lt;script type="text/javascript" src="{% url 'django.views.i18n.javascript_catalog' 'locale' %}" &gt;&lt; /script &gt;
  </code></pre></li>
  </ol>
  
  <p>Note that I added 'locale' to avoid the exception of not passing the package name when dynamically loading translations.</p>
  
  <ol>
  <li><p>Visited <code>/jsi18n/locale/</code> from my browser and all I get is Django translation functions:</p>
  
  <pre><code>/* gettext library */
  
  var catalog = new Array();
  
  function pluralidx(count) { return (count == 1) ? 0 : 1; }
  
  
  function gettext(msgid) {
  ....
  </code></pre></li>
  </ol>
  
  <p>Why 'this is to be translated' is not showing and on which basis it will show a specific language without passing it with the URL?</p>