question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to prevent translation of <title>?

See original GitHub issue

I want to prevent translation for <title> element. But, this extension always translates <title>'s text content.

Env:

  • Firefox 88.0
  • Extension version: 8.9.3
  • Language: Japanese

Reproduce Steps:

  1. Install this extension
  2. Visit https://github.com/FilipePS/Traduzir-paginas-web/issues
  3. Click popup icon
  4. Select translation language

As a result, this extension translated <title>.

image

tranlate attribute and notranslate class that is under the document.body seems to works. https://output.jsbin.com/pitelunayo But, <title translate="no"> does not work.

image

Context:

Sharing features like Twitter button refers to document.title. I do not want to share the translated title.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
azucommented, Apr 30, 2021

In my opinion, the translator should check the element’s translate attribute before translate the element’s attribute like alt or placeholder.

For example, Google translates has checked the translate=no attribute before translating alt text. https://translate.google.com/translate?sl=auto&tl=ja&u=https://output.jsbin.com/gohurijocu

    <img alt="HELLO TEXT" src="" />  ← will be translated
    <input value="SUBMIT" type="submit" />  ← will be translated
    <hr>
    <h3>with translate=no</h3>
    <img alt="HELLO TEXT" src="" translate="no" />  ← will not be translated
    <input value="SUBMIT" type="submit" translate="no" /> ← will not be translated
    </body>

WHATWG HTML spec said that

The translate attribute is an enumerated attribute that is used to specify whether an element’s attribute values and the values of its Text node children are to be translated when the page is localized, or whether to leave them unchanged. https://html.spec.whatwg.org/multipage/dom.html#attr-translate

0reactions
azucommented, May 10, 2021

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Stop YouTube From Translating Video Titles
How to Stop YouTube From Translating Video Titles ; Open the YouTube app. In the top-right corner, tap on your profile picture. Go...
Read more >
languages - Disable title translation of YouTube videos
You can change it. Go to You Tube ---> Settings --->Subtitles --->You will be redirect to Google Subtitles(CC) ---> Under regular options you ......
Read more >
How to Stop Youtube Translating Video Titles to Your ...
This one so far the most effective way to stop automatic video title translation. For PC users, just head to the profile picture...
Read more >
How to stop YouTube from translating video titles and ...
You can stop YouTube from translating video titles and descriptions by changing the language settings on your channel. · To change these settings,...
Read more >
How to disable the automatic title translation from Youtube?
General preferences for the web" section and in the "Language" settings add the language you speak. So if your German videos are translated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found