FilipePS / Traduzir-paginas-web

Translate your page in real time using Google or Yandex
https://addons.mozilla.org/pt-BR/firefox/addon/traduzir-paginas-web/
Mozilla Public License 2.0
4.49k stars 540 forks source link

[FR] Ignoring code blocks from translation #348

Open boromyr opened 2 years ago

boromyr commented 2 years ago

As per title, I propose a new feature to prevent translation to some sensitive areas of web pages. When a web page is translated with TPW or a built-in translator like in Chrome and Edge, it is translated in full, including sections containing code like in GitHub or any site containing scripts or instructions that need to be copied exactly. This can lead to constant switching between translations or to copy errors. Preventing translation in these areas will make TPW much more efficient and enjoyable.

Examples

Before:

Hi print("Hello Word")

After:

Ciao / Bonjour / Hallo / ecc. stampante "Ciao Mondo"

Improved:

Ciao / Bonjour / Hallo / ecc. print("Hello Word")

FilipePS commented 2 years ago

If this is happening on any site, it is the fault of the site itself that does not use the html tags properly. The extension does not translate <code> tags. If any site uses the <code> tag and the extension is still translating, then please send me the site link as an example.

boromyr commented 2 years ago

In reality, it happens on many sites, but in particular I refer to GitHub and analogues, as in GreasyFork.org Practical example, a code I was reading right now: https://github.com/PaulStoffregen/XPT2046_Touchscreen/blob/master/XPT2046_Touchscreen.cpp

ghost commented 2 years ago

I have the same problem on this page : https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Persistence.md

And this page for example : https://www.ired.team/offensive-security/privilege-escalation/windows-namedpipes-privilege-escalation

boromyr commented 2 years ago

I tried them, same problem for me too.