<%- gettext "" %> Don't work

<%- gettext(“Support education research by providing additional information”) %>
I created custom string in
/edx/app/edxapp/edx-platform/conf/locale/fr/LC_MESSAGES/djangojs.po
for translate this string, but it don’t work, but other buttons translated

Hi @Chack, did you recompile your locale files after editing? The gettext library doesn’t directly reference .po files, but instead references .mo files that are compiled from the .po files.

You can recompile these files with a management command run from edx-platform’s manage.py:

 sudo -Hsu edxapp /edx/bin/{python,manage}.edxapp lms --settings=devstack_docker compilemessages

This works in my devstack, but you’ll have to change the --settings option to reference the correct settings for your environment. --settings=production will work for instances running on AWS for example.

Hello @Chack,

When you add any strings in djangojs.po file you must run below commands and it will be working for you.
sudo -H -u edxapp bash
source ~/edxapp_env
cd ~/edx-platform/
python manage.py lms compilejsi18n --settings=production
python manage.py lms compilemessages --settings=production

4 Likes