title: Django JavaScript Translation gettext is not defined
body: <p>My javascript function contains the following:</p>
  
  <pre><code>document.getElementById("example").innerHTML = gettext("This is an example");
  </code></pre>
  
  <p>My urls.py looks like:</p>
  
  <pre><code>urlpatterns = [
      url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
      url(r'^admin/', admin.site.urls),
      url(r'^', include('project.urls')),
      url(r'^login/$', auth_views.login, {'template_name': 'login.html', 'authentication_form': LoginForm}, name = 'login'),
      url(r'^logout/$', auth_views.logout, {'next_page': '/login'}),
      url(r'^i18n/', include('django.conf.urls.i18n')),
  ]
  </code></pre>
  
  <p>And in my template I have:</p>
  
  <pre><code>&lt;script type="text/javascript" src="{% url 'javascript-catalog' %}"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>The translation above using gettext() does not work. A Reference Error comes up saying gettext() is not defined. However, in the same javascript file i have: </p>
  
  <pre><code>var monthNames =  [gettext("January"), gettext("February"), gettext("March"), gettext("April"), gettext("May"), gettext("June"), gettext("July"), gettext("August"), gettext("September"), gettext("October"), gettext("November"), gettext("December")];
  </code></pre>
  
  <p>And that does not prompt a reference error. The month translations work but the example one does not. </p>