Gopherjs: 'gopherjs serve': Chrome thinks the page is in Italian

Created on 4 Jan 2017  路  2Comments  路  Source: gopherjs/gopherjs

When visiting the gopherjs serve main page, Chrome seems to think the page is in Italian:

image

I believe this is because the page does not include proper Content-Language meta tags:

<meta http-equiv="Content-Language" content="en">

See e.g.: http://stackoverflow.com/questions/2467454/why-does-chrome-incorrectly-determine-page-is-in-a-different-language-and-offer

Most helpful comment

Agreed with @flimzy.

I just want to add that http.FileServer does not set <meta http-equiv="Content-Language" content="en">, and that's what gopherjs serve uses. So to some degree, this is a bug you should file against net/http. Of course, GopherJS could be modified to use a custom implementation instead of the one from net/http, but you get my point.

Also, I can't repro this, I'm guessing it happens to you because of one of the folder names.

image

That would suggest this won't affect many people.

All 2 comments

Setting the language on a directory listing feels dirty to me. What if my filenames are in Italian? Or what if they are English, but my browser is in another language? I certainly don't want that page to be translated. It's really not in any (human) language at all. I don't know if there's an official way to handle this situation, but I would at least experiment with the first two lines in that SO answer:

<meta charset="UTF-8">
<meta name="google" content="notranslate">

And see if that alone does the trick. If not, then specifying en might be better than not... but it doesn't feel "right" to me.

Agreed with @flimzy.

I just want to add that http.FileServer does not set <meta http-equiv="Content-Language" content="en">, and that's what gopherjs serve uses. So to some degree, this is a bug you should file against net/http. Of course, GopherJS could be modified to use a custom implementation instead of the one from net/http, but you get my point.

Also, I can't repro this, I'm guessing it happens to you because of one of the folder names.

image

That would suggest this won't affect many people.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

flimzy picture flimzy  路  4Comments

hajimehoshi picture hajimehoshi  路  6Comments

4ydx picture 4ydx  路  3Comments

flimzy picture flimzy  路  3Comments

marwan-at-work picture marwan-at-work  路  4Comments