Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Specification in Header #174

Closed
kailashvele opened this issue Oct 26, 2017 · 5 comments
Closed

Language Specification in Header #174

kailashvele opened this issue Oct 26, 2017 · 5 comments

Comments

@kailashvele
Copy link

Option to specify the language is missing, without that Chrome cannot suggest the full page translation also the content rendering may face some problem or performance problem as browser will have to identify it (maybe).

@willpower232
Copy link

This interests me as I had not previously considered this scenario.

According to this https://webmasters.stackexchange.com/a/5073 google may well prefer the server to send the header rather than relying on meta data.

Furthermore, MDN suggests that specifying the language on <html> is now the preferred option and the meta tag is obsolete https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta

Excuse me whilst I go and double check I've specified the language everywhere...

@scottaohara
Copy link
Collaborator

Hi @kailashvele,

The language for a document should be specified on the html element:

<!doctype html>
<html lang="en">
  <head>
    ...
  </head>

There was a <meta http-equiv="Content-Language" content="en"> declaration that used to belong in the head. However this meta tag has been deprecated.

Setting the lang attribute on the html element, or on content wrapping elements within the body (if the language is different for a section of content than the language set at the document level), is the appropriate way to declare language these days.

@kailashvele
Copy link
Author

Sure, I considered it should be the part of document as well or we can add this point in the documentation that Lang meta is deprecated you can put it on html. :)

@scottaohara
Copy link
Collaborator

There used to be a section for deprecated tags, but it was becoming more common for people to be making PRs for tags that belonged in the deprecated section, than useful content for the head.

The document was streamlined to only focus on the useful content that belongs in the head of a document, and anything that wasn't considered useful or falls outside of the head wasn't included.

You're right that making people aware of setting an appropriate language is for a document is important. Unfortunately that just falls out of the scope of this project.

@kailashvele
Copy link
Author

Oh Okay, sounds a valid reason :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants