Issue Mathjax & Google Chrome translation

Issue Mathjax & Google Chrome translation

by Pep Mulet Pol -
Number of replies: 2

Hi,

I use Mathjax 2.7.8 (https://cdn.jsdelivr.net/npm/mathjax@2.7.8/MathJax.js) in my Moodle books to display LaTeX mathematics. Our site has Moodle 3.8.4 with bootstrap theme.

Some of our students use the feature of Google Chrome to translate the contents from Catalan to Spanish.


During this process, some parts of the formulas get translated and, in other cases, the typesetting is unsuitable.


I have found a workaround which consists in wrapping every formula between <span class="notranslate">\(LaTeX whatever\)</span> to tell Google not to translate that formula. The problem is that this is a very time-consuming fix, and I wonder if anyone else has found a better solution to this problem? In particular, is it possible to add the wrapper as a template in the configuration of Mathjax? At the moment, we have the following code:


Thanks in advance,

Josep

Average of ratings: -
In reply to Pep Mulet Pol

Re: Issue Mathjax & Google Chrome translation

by Pep Mulet Pol -
Hi there,
I think that a candidate solution could be create a filter that detects math and performs the wrapping.
Josep
In reply to Pep Mulet Pol

Re: Issue Mathjax & Google Chrome translation

by Daniel Thies -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The core MathJax filter wraps mathematical expressions in a span with class filter_mathjaxloader_equation added and also one with a nolink class that glossary filter is suppose to respect.. You may be able to modify that filter to also add the notranslate class.