Skip to content

Conversation

@enumura1
Copy link
Contributor

@enumura1 enumura1 commented Jun 16, 2025

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

This fixes a bug where the development server always uses lang="en" in HTML regardless of the configured i18n.defaultLocale.

Test Plan

  1. Created a new Docusaurus site with i18n.defaultLocale: 'ja'
  2. Started development server with npm start
  3. Before fix: HTML showed <html lang="en"> - causing browser translation popups
  4. After fix: HTML correctly shows <html lang="ja"> - no inappropriate popups

Before
image

After
image

Test links

Deploy preview: https://deploy-preview-11271--docusaurus-2.netlify.app/

Related issues/PRs

fix #11253

@facebook-github-bot
Copy link
Contributor

Hi @enumura1!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@netlify
Copy link

netlify bot commented Jun 16, 2025

[V2]

Name Link
🔨 Latest commit 684ea6b
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/68515956286fe70008c4627d
😎 Deploy Preview https://deploy-preview-11271--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 project configuration.

@github-actions
Copy link

github-actions bot commented Jun 16, 2025

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO Report
/ 🔴 42 🟢 98 🟢 100 🟢 100 Report
/docs/installation 🔴 49 🟢 97 🟢 100 🟢 100 Report
/docs/category/getting-started 🟠 70 🟢 100 🟢 100 🟠 86 Report
/blog 🟠 55 🟢 96 🟢 100 🟠 86 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 56 🟢 92 🟢 100 🟢 100 Report
/blog/tags/release 🟠 59 🟢 96 🟢 100 🟠 86 Report
/blog/tags 🟠 70 🟢 100 🟢 100 🟠 86 Report

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jun 16, 2025
@slorber slorber changed the title fix: dev server HTML lang attribute fix(dev-server): use correct dev server HTML lang attribute Jun 17, 2025
@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Jun 17, 2025
Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

LGTM thanks

Just did a minor change since the locale name can be anything and may not be a BCP47 locale

@slorber slorber merged commit a94fdbe into facebook:main Jun 17, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTML lang attribute initialization exception

3 participants