Closed Bug 1904976 Opened 2 years ago Closed 1 year ago

don't parse inline <script> for translations

Categories

(Firefox :: Translations, enhancement)

Firefox 129
enhancement

Tracking

()

RESOLVED INVALID
Tracking Status
firefox129 --- affected

People

(Reporter: thorin, Unassigned)

Details

Attachments

(1 file)

Attached image translating script.png —

In one of my tests, I found translations offered to translate it from French to English. It was already in English. So I wrapped the content part in a translate="no" span. It persisted. Something in my inline <script> obviously triggered it. I find that odd. Perhaps we should ignore "non-readable", if that's the right word, parts of the html file such as inline scripts, and comments etc - not just to eliminate false suggestions (e.g. from French when it wasn't in French in my case) but also for perf. IDK if any of those others trigger it, but the PoC below illustrates <script>

PoC

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>translate</title>
</head>

<body>
<span translate="no">
	<p>moeten worden toegevoegd of uitgesloten op basis van de opmaaktaal elke sitemap mag alleen de s bevatten voor een bepaalde opmaaktaal dit</p>
</span>

<script>
'use strict';
let var = 'moeten worden toegevoegd of uitgesloten op basis van de opmaaktaal elke sitemap mag alleen de s bevatten voor een bepaalde opmaaktaal dit'
</script>
</body>
</html>

I've probably misunderstood this and no one has replied, so closing as invalid

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: