Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.8k
fix: Update language support#1488
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Required to trigger auto-translate feature in applicable Chromium-based browsers (Chrome & Edge)
vercelbot commentedFeb 4, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect:https://vercel.com/docsify-core/docsify-preview/1stwj93rt |
codesandbox-cibot commentedFeb 4, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This pull request is automatically built and testable inCodeSandbox. To see build info of the built libraries, clickhere or the icon next to each commit SHA. Latest deployment of this branch, based on commit2626036:
|
Uh oh!
There was an error while loading.Please reload this page.
It seems that the test snapshot file needs to be updated |
Co-authored-by: 沈唁 <52o@qq52o.cn>
…s/docsify into update-language-support
jhildenbiddle commentedFeb 5, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@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.
Uh oh!
There was an error while loading.Please reload this page.
Summary
Dynamically set the HTML
langattribute 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 aslangattribute changes are not recognized on hash change. For example:https://docsify.js.org/
https://docsify.js.org/#/zh-cn/
Remove the
write-a-plugin.mdalias 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 thebefore/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.)