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

feat(theme-classic): use lang attribute in navbar locale dropdown items #7942

Merged
merged 2 commits into from Aug 12, 2022

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Aug 11, 2022

Motivation

Apparently, this improves accessibility a bit, and also helps SEO crawlers

https://twitter.com/mgechev/status/1518447256034238464
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang
https://www.w3schools.com/tags/att_global_lang.asp


Note: wonder if we shouldn't also use it for localized sites where some docs are not translated yet 🤷‍♂️ I guess the lang of a doc in such case is not the lang of the i18n site (as the doc is actually not translated) but the default locale instead

@slorber slorber added pr: polish This PR adds a very minor behavior improvement that users will enjoy. domain: i18n Related to the i18n system labels Aug 11, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 11, 2022
@netlify
Copy link

netlify bot commented Aug 11, 2022

[V2]

Name Link
🔨 Latest commit 7c4cecf
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/62f62a7131d47a0008ad86b4
😎 Deploy Preview https://deploy-preview-7942--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Aug 11, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟢 94 🟢 98 🟢 100 🟢 100 🟠 80 Report
/docs/installation 🟠 82 🟢 100 🟢 100 🟢 100 🟢 90 Report

@github-actions
Copy link

github-actions bot commented Aug 11, 2022

Size Change: +75 B (0%)

Total Size: 812 kB

Filename Size Change
website/build/index.html 40.8 kB +56 B (0%)
ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/globalData.json 52.5 kB 0 B
website/build/assets/css/styles.********.css 111 kB 0 B
website/build/assets/js/main.********.js 608 kB +19 B (0%)

compressed-size-action

@Josh-Cena Josh-Cena removed the domain: i18n Related to the i18n system label Aug 11, 2022
* `<link ... hreflang="...">`
* BCP 47 language tag to use in:
* - `<html lang="...">`
* - `<li lang="...">`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<li> or <a>, or doesn't really matter? Also need to put this into the actual docs since they are in sync.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced by

`<html lang="...">` (or any other DOM tag name)

Somehow HTML, li, a are all the case case 🤪

@Josh-Cena Josh-Cena added the domain: i18n Related to the i18n system label Aug 11, 2022
@slorber slorber added the to backport This PR is planned to be backported to a stable version of Docusaurus label Aug 12, 2022
@slorber slorber merged commit ad15605 into main Aug 12, 2022
@slorber slorber deleted the slorber/use-lang-attribute-in-locale-dropdown branch August 12, 2022 10:33
@slorber slorber added backported This PR has been backported to a stable version of Docusaurus and removed to backport This PR is planned to be backported to a stable version of Docusaurus labels Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR has been backported to a stable version of Docusaurus CLA Signed Signed Facebook CLA domain: i18n Related to the i18n system pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants