Applying Google's notranslate to all katex blocks

33 Views Asked by At

I have a blog built with gatsby.js in which I insert math formulas using gatsby-remark-katex.

I noticed that the math blocks it generates are wrapped within elements with class="katex-display" or class="katex".

When I use Google translate on my blog (from french to english), the math formulas are translated, e.g. "a" (variable name) gives "has", which is annoying.

I see that Google provides a class="notranslate" to indicate that a block should not be translated (https://developers.google.com/search/blog/2008/10/helping-you-break-language-barrier).

What would you recommend as an easy (i.e. no need to patch a dependency) way to apply that class to all math blocks? (or any other way to pass that information to Google Translate)

0

There are 0 best solutions below