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.

Set the right HTML lang attribute

See original GitHub issue

Independent of uplifting or unfreezing or “dropping” locales, we’re still rendering localized content. So we should get the <html lang="en"> tag right. E.g. view-source:https://developer.allizom.org/fr/docs/Web

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
peterbecommented, Feb 12, 2021

Then, let’s just do it. The code for figuring out the lang based on the locale is probably the same as we do for the hreflang meta tags. I’ll attempt this next week.

1reaction
Ryuno-Kicommented, Feb 12, 2021

A screenreader will switch pronounciation accordingly.

For example, Berlin is pronounced differently depending on your language: https://en.wiktionary.org/wiki/Berlin (the speaker within that article play back some audio file)

It can have a serious effect on their UX: https://webaim.org/techniques/screenreader/#video (English text spelled with Czech pronounciation for demo purposes).

Also, it might help crawlers to categorise the content a bit better.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Declaring language in HTML - W3C
The xml:lang attribute is the standard way to identify language information in XML. Ensure that the values for both attributes are identical.
Read more >
lang - HTML: HyperText Markup Language - MDN Web Docs
The lang global attribute helps define the language of an element: the language that non-editable elements are written in, or the language ......
Read more >
Using the HTML lang attribute - TPGi
The HTML lang attribute is used to identify the language of text content on the web. This information helps search engines return language ......
Read more >
How to fix: Consider adding a “lang” attribute to the “html” start ...
Always use a language attribute on the <html> tag to declare the default language of the text in the page, using the lang...
Read more >
<html> element must have a lang attribute | Axe Rules
Add a lang attribute to the html element (e.g. <html lang="en"> ) whose value represents the primary language of document. Make sure you...
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