devilry / devilry-django

Devilry project main repository
http://devilry.org
BSD 3-Clause "New" or "Revised" License
51 stars 24 forks source link

`window.gettext` warning #1234

Closed torgeirl closed 2 years ago

torgeirl commented 2 years ago

static/devilry_theme3/5.5.1/scripts/devilry_all.js seems to be using a function that isn't defined:

window.gettext is not defined. Patching window.gettext and related functions with noop fallbacks. Make sure you import/include a full gettext translation system like the Django JavascriptCatalog view before ievv_jsbase or any javascript using ievv_jsbase to get translations.

espenak commented 2 years ago

This is just a warning because of async stuff. We can just ignore this unless it leads to things not being translated. The check is made at load time, so if the "library" that we have that wraps window.*gettext that django exports is loaded before the django translation catalog javascript, the warning is shown. But when the methods to get translations is called, it will use the django translation catalog as long as that too is loaded (which it will be since we normally render JS stuff after the "load" event).