The problem
Buttons are not functioning properly if a user is viewing the site in French locale.
Background Info
I am using {% trans %} tag to translate button text directly in my Django template. Inside of my script tags, I am also using {% trans %} tags to add translation after a button action is triggered (onclick): let show_correction = '{% trans "Show native corrections" %}';.
In French locale it becomes: let show_correction='Afficher les corrections d'autres locuteurs natifs';. I think the issue is happening specifically in d'autres.
My Guess
Maybe the function is terminating earlier because of the apostrophe?
How in the world can I fix this?
Solution: https://docs.djangoproject.com/en/3.2/topics/i18n/translation/#module-django.views.i18n
Basic usage:
let foo = gettext("Your string to be translated");