How to disable google translate from html in chrome

前端 未结 6 1961
星月不相逢
星月不相逢 2020-11-27 11:32

I just made a website for a french restaurant. The website is in english, but I guess there is enough french on the website (labeled pictures of menu items) to prompt the v

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 11:36

    FYI, if you want something that will work for all content in your site (including that which is not HTML), you can set the Content-Language header in your response (source) to the appropriate language, (in my case, en-US).

    This has the benefit here is that it will "disable" the offer to translate the page for you (because it will know the source language correctly), but for other, non-native readers, they will still have the option to translate your site into their own language, and it will work correctly.

    (Also for my use case, where Chrome was offering to translate well formatted JSON from latin to English, that BS goes away.)

提交回复
热议问题