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

fix: Update language support #1488

Merged
merged 8 commits into from
Feb 5, 2021
Merged

Conversation

jhildenbiddle
Copy link
Member

@jhildenbiddle jhildenbiddle commented Feb 4, 2021

Summary

  1. 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 as lang attribute changes are not recognized on hash change. For example:

    https://docsify.js.org/

    <html lang="en">

    https://docsify.js.org/#/zh-cn/

    <html lang="zh-cn">
  2. Remove the write-a-plugin.md alias as it appears to be unnecessary

  3. Add Russian and Spanish search-related label translations

What kind of change does this PR introduce? (check at least one)

  • Feature
  • Docs

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)
    Chrome1

  • After
    Chrome2

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

@vercel
Copy link

vercel bot commented Feb 4, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/docsify-core/docsify-preview/1stwj93rt
✅ Preview: https://docsify-preview-git-update-language-support.docsify-core.vercel.app

@jhildenbiddle jhildenbiddle requested review from sy-records and a team and removed request for sy-records February 4, 2021 21:11
@jhildenbiddle jhildenbiddle changed the title Update language support fix: Update language support Feb 4, 2021
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 4, 2021

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:

Sandbox Source
docsify-template Configuration

sy-records
sy-records previously approved these changes Feb 5, 2021
index.html Outdated Show resolved Hide resolved
@sy-records
Copy link
Member

It seems that the test snapshot file needs to be updated

@jhildenbiddle
Copy link
Member Author

jhildenbiddle commented Feb 5, 2021

It seems that the test snapshot file needs to be updated

@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.

@sy-records sy-records requested a review from a team February 5, 2021 01:07
Copy link
Member

@Koooooo-7 Koooooo-7 left a comment

Choose a reason for hiding this comment

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

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants