-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
fix: Update language support #1488
Conversation
Required to trigger auto-translate feature in applicable Chromium-based browsers (Chrome & Edge)
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/docsify-core/docsify-preview/1stwj93rt |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2626036:
|
It seems that the test snapshot file needs to be updated |
Co-authored-by: 沈唁 <52o@qq52o.cn>
…s/docsify into update-language-support
@sy-records Yep. Good catch. I didn't test locally because I need the changes from #1487 to test on my ARM-based Mac. Should be all set now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Summary
Dynamically set the HTML
lang
attribute based on URL hash. This attribute must be set properly in order to trigger auto-translation features on applicable Chromium-based browsers (Chrome, Edge). Note that this fix works only for the initial page load aslang
attribute changes are not recognized on hash change. For example:https://docsify.js.org/
https://docsify.js.org/#/zh-cn/
Remove the
write-a-plugin.md
alias as it appears to be unnecessaryAdd Russian and Spanish search-related label translations
What kind of change does this PR introduce? (check at least one)
If changing the UI of default theme, please provide the before/after screenshot:
Before (notice the lack of the translation option in the URL bar)
After
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)You have tested in the following browsers: (Providing a detailed version will be better.)