5

Today I was having some issues with Nuxt and came upon this question:

Nuxt Hot reloading for new components Is not working

When I visit this page in Chrome I get a prompt to translate the page from French. The post is in English although English does not appear to be the native language of the question asker.

It looks like SO is not using the lang attribute. Perhaps that could help with both accessibility and to prevent weird translation prompts like this?

It was tested on two different devices running Chrome version 78.0.3904.108 (Official Build) (64-bit). Safari does not appear to have the issue.

15
  • Does same for me. I copy/pasted the whole post (from Edit) into Google Translate with "Detect Language" selected, and it correctly detected English. Perhaps it's something else on/in the page? I thought it'd be the word nuxt, but that in Google Translate auto-detects as Swedish...Edit: Ah, I put nuxt vue in GT, and it detected as French. Maybe it's the combo of those words used in the "Related Posts" section?
    – BruceWayne
    Commented Dec 5, 2019 at 22:35
  • 1
    Interesting, seems like this could be alleviated if SO used the lang attribute though, no?
    – maxshuty
    Commented Dec 5, 2019 at 22:47
  • 3
    I am French native. No reason why it detects French. There are some French words here and there on that page but that page is definitely English first
    – Patrice
    Commented Dec 6, 2019 at 0:39
  • 3
    Yep, I've seen a few questions that get mistakenly suggested for translation, often posts with lots of code. I downloaded the page, added the lang="en" attribute to the <html, then opened the page locally, but a translation was still suggested by Chrome. There might be a solution, but setting lang there doesn't seem to work Commented Dec 6, 2019 at 0:40
  • 2
    An answer says the solution is to add <meta name="google" content="notranslate">. Works for me, no translation gets suggested Commented Dec 6, 2019 at 0:45
  • 1
    Chrome tends to be a little overzealous when suggesting translations. If there are a few words it thinks it recognizes, it'll offer to translate, even if the rest of the page is in whatever language you have set. Commented Dec 6, 2019 at 2:03
  • 2
    @CertainPerformance that's assuming only English-speaking visitors come to SO. Yes the community shall speak in English (to the best of their abilities), but disabling translation altogether is probably not a solution.
    – Kaiido
    Commented Dec 6, 2019 at 2:08
  • @Kaiido Good point, so maybe a per-user setting is needed instead. That's pretty unlikely to happen though. But a userscript seems to do the trick: document.head.insertAdjacentHTML('beforeend', '<meta name="google" content="notranslate">'); plus instant script injection Commented Dec 6, 2019 at 3:16
  • 4
    Yeah or ask google to fix their translator. I played a bit with that page and randomly removing japanese characters or a css file, or "Home" or othef things that are not French in any way, will make it silent, but replacing "vue" which is the only word there that could be French (I am native speaker) didn't had real influence... I'm clueless has to what happens, but clearly the culprit is that algo, not the page.
    – Kaiido
    Commented Dec 6, 2019 at 3:47
  • 1
    Chrome has always been a bit off when suggesting translations. It'd suggest to translate pages from my native language to English a lot, even though I've told it "No, never do that" more than once. Then I'd open a page in a different language and it'd never suggest translation. Also for a page in English which includes a quoted sentence or two in, say German (which is also translated immediately after), Chrome says "This page is in German, do you want to translate it?". I'm surprised others are surprised by this - I don't use Chrome as my main browser, yet I've seen make mistakes a lot.
    – VLAZ
    Commented Dec 6, 2019 at 8:39
  • My guess is because the page begins with (and frequently references) Nuxt or Nuxt.js, which is a language translation library for Vue. Google's algorithms probably crawl the web for top-related search results and discover "this is French" when looking at its results for some reason.
    – TylerH
    Commented Dec 6, 2019 at 15:15
  • 2
    I suspect it's the page <title> that's tripping it up, as it begins with "vue" : <title>vue.js - Nuxt Hot reloading for new components Is not working - Stack Overflow</title>
    – CD001
    Commented Dec 6, 2019 at 16:21
  • @Kaiido I believe if you have a language preference set in Chrome wouldn't it actually help to tell Chrome that a given page is in English. Then if someone who is a non-native speaker and has a difference preference set and they visit the page they will see a prompt to translate it from English to their native language? Perhaps I'm wrong, this stuff is a bit fuzzy for me.
    – maxshuty
    Commented Dec 9, 2019 at 14:27
  • @maxshuty My first comment was a response to an idea to simply disable google's translator. That's apparently the only thing StackOverflow could do on their end, but then raises the concern that it might be better some of us have this notice while they don't need rather than the ones who need it never have the translation. Once again, that's a weird bug from google, if it really annoys you, you can raise a bug to them: crbug.com
    – Kaiido
    Commented Dec 9, 2019 at 23:40
  • Oh and if you wish, here is what seems to be the minimal content from that page to trigger the translator (removing anything in content will disable the translator) From that page the remaining words that do exist in French are "router", "sans" and "font"
    – Kaiido
    Commented Dec 10, 2019 at 2:06

0

You must log in to answer this question.

Browse other questions tagged .