79373841

Date: 2025-01-21 09:32:59
Score: 1.5
Natty:
Report link

This question is actually ambiguous.
It seems to be asking "How should I modify the HTML of a web page so that a specific part is not be translate?"
But it can also be understood as "I'm the user of page, how should I do to prevent a part of the page be translate?"

The former has been answered, so I will answer the latter.
Save this snippet into your chrome devtools Source - Snippets tab:

function setNoTranslate(selector) {
    var elements = document.querySelectorAll(selector);
    elements.forEach(element=>element.classList.add('notranslate'));
}
function setCanTranslate(selector) {
    var elements = document.querySelectorAll(selector);
    elements.forEach(element=>{
        element.classList.remove('notranslate');
        element.translate="yes";
    });
}

And than run it on the page if you want.
Call setNoTranslate or setCanTranslate with DOM selector in console, it will set target element should or not be translate.

Reasons:
  • Blacklisted phrase (1): How should I
  • Blacklisted phrase (1): how should I
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
Posted by: Mr. Squirrel.Downy