question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Django 1.8 / Python 3.3/3.4 Uncaught ReferenceError: pgettext is not defined

See original GitHub issue

I recently moved over to django 1.8 and Python3. I completely understand that this is experimental for Python 3 and is valid for up to Django 1.7 but I am having an issue.

I continue to get Uncaught ReferenceError: pgettext is not defined. I tried following the instructions:

js_info_dict = {
    'packages': ('recurrence', ),
}
# jsi18n can be anything you like here
urlpatterns += patterns(
    (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
)

but I am still getting errors. I am not sure if the errors are “expected” with Django 1.8 or if I might be just doing something wrong.

The error is at:

recurrence.display.weekdays_oneletter = [
    pgettext('Monday first letter', 'M'),   <-- Here
    pgettext('Tuesday first letter', 'T'),
    pgettext('Wednesday first letter', 'W'),

though is probably not too surprising. 😃

Any ideas would be appreciated.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Bariumcommented, Jul 22, 2020

I have same problem using Python 3.8, django-recurrence 1.10.3, Django version 3.0.8. It works in the admin page, but does not work when viewing the regular form. I get the error:

Uncaught ReferenceError: pgettext is not defined <anonymous> http://localhost:8000/staic/recurrence/js/recurrence.js:1038

Tested with both Firefox and Safari. I have followed the guide and added the JavaScript catalog to the urls.py of the project. I have added {{ form.media }} to the form template before the {{ form }} but after csrf token, as shown in the guide.

I have tried with both LANGUAGE_CODE set to en-us and da, and the same behavior exists.

Following the solution in https://github.com/django-recurrence/django-recurrence/issues/153 solved the issue for me, perhaps the documentation should be update to reflect this.

0reactions
pedrofaria09commented, Aug 13, 2021

Hello, Im with a problem using recurrence and autocomplete at the same time. My page is divided in 2 forms: 1st form- containing autocomplete, datepicker, etc. 2nd form- containing recurrence and MultiSelectField. When I comment {{ form2.media }}, I got autocomplete working but recurrence doesn’t work: Captura de ecrã 2021-08-13, às 15 13 21

When I use {{ form2.media }}, recurrence works, but autocomplete doesn’t: Captura de ecrã 2021-08-13, às 15 14 05

If I use the recurrence in 1st form, neither autocomplete and datepicker works, only recurrence.

Any help please?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues - GitHub
I recently moved over to django 1.8 and Python3. ... Django 1.8 / Python 3.3/3.4 Uncaught ReferenceError: pgettext is not defined #47.
Read more >
Django javascript translation catalog file is failing to load ...
Django javascript translation catalog file is failing to load, showing error - ReferenceError: gettext is not defined.
Read more >
Translation | Django documentation
Python's standard library gettext module installs _() into the global namespace, as an alias for gettext() . In Django, we have chosen not...
Read more >
django-recurrence - Bountysource
... for Python 3 and is valid for up to Django 1.7 but I am having an issue. I continue to get Uncaught...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found