Repository navigation
feat: replace locale auto-redirect with a language suggestion banner - #366
Merged
Merged
Conversation
fenbox
force-pushed
the
feat/language-suggestion-banner
branch
from
November 26, 2026 04:28
4523b1f to
b9483e6
Compare
- Show a dismissible top banner when the browser language is Simplified Chinese on the English site, instead of redirecting automatically - Remember an explicit language choice in localStorage and go straight to the chosen locale on return visits - Compact the navbar locale dropdown to an icon-only trigger - Remove unused dependencies - Add AGENTS.md contributor guidelines
fenbox
force-pushed
the
feat/language-suggestion-banner
branch
from
November 26, 2026 04:44
b9483e6 to
9bcf9bf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Language suggestion banner
Previously, visitors whose browser language matched Chinese were automatically redirected to the Chinese version of the site. This PR replaces that behavior with a dismissible suggestion banner at the top of the page:
alert alert--secondarybanner only when the browser language is Chinese and the current page is the English site/zh-CN/path (preserving query and hash)AnnouncementBar/CloseButton) dismisses it for the session viasessionStorageNavbar locale dropdown
The locale dropdown previously rendered the full locale label ("English" / "简体中文") in the navbar, taking significant horizontal space. It is now an icon-only trigger with an
aria-labelfor accessibility; the dropdown menu still shows full language names.Dependency cleanup
Removes unused dependencies:
@docusaurus/theme-mermaid,@docusaurus/theme-search-algolia,hast-util-is-element,mixpanel-browser,sass-loader.Misc
AGENTS.mdwith repository guidelines for AI coding agentsValidation
/zh-CN/pages/zh-CN/path; close button dismisses and persists for the sessiondocusaurus build --locale ensucceeds (existing broken-anchor warnings unchanged)