jelmervdl / translatelocally-web-ext

TranslateLocally for the Browser is a web-extension that enables client side in-page translations for web browsers.
https://addons.mozilla.org/en-GB/firefox/addon/translatelocally-for-firefox/
Mozilla Public License 2.0
65 stars 3 forks source link

Update `lang` attribute after translation #66

Open jelmervdl opened 1 year ago

jelmervdl commented 1 year ago

I'm wondering, if you translate a <p lang="de">Hallo Welt</p> to English, but leave the lang="de" bit intact, does it confuse browsers? Firefox right now doesn't have a native translation feature, but if it had, it would still see the page as German maybe and offer translation. I should test this in other browsers that do have it (Chrome, Safari…)

Slightly related: Google has a convention for marking nodes that are translation output: https://cloud.google.com/translate/markup