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

Feat/i18n for docs wechaty #1514

Merged
merged 5 commits into from
Jun 1, 2023
Merged

Conversation

hcfw007
Copy link
Member

@hcfw007 hcfw007 commented Jan 31, 2023

rework doc wechaty section
add i18n support
#1512

@hcfw007 hcfw007 mentioned this pull request Jan 31, 2023
3 tasks
Copy link
Member

@huan huan left a comment

Choose a reason for hiding this comment

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

LGTM

This PR looks promising!

Please:

  1. update the PR to the latest main branch and make sure it can pass the CI
  2. paste some screenshots in the PR description (Issue will be better) so that we can see what it looks like after it has been merged!

@huan huan enabled auto-merge (squash) April 26, 2023 07:33
auto-merge was automatically disabled May 16, 2023 14:11

Head branch was pushed to by a user without write access

@hcfw007 hcfw007 force-pushed the feat/i18n-for-docs-wechaty branch from 953759b to b7d62d1 Compare May 17, 2023 02:53
@hcfw007 hcfw007 requested a review from huan May 17, 2023 02:56
@hcfw007
Copy link
Member Author

hcfw007 commented May 17, 2023

This PR is ready to be reviewed. It will fullly focus on i18n part. I'll open another PR for doc update.

windmemory
windmemory previously approved these changes May 17, 2023
Copy link
Member

@windmemory windmemory left a comment

Choose a reason for hiding this comment

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

LGTM

su-chang
su-chang previously approved these changes May 23, 2023
@hcfw007 hcfw007 dismissed stale reviews from su-chang and windmemory via 36ef777 May 24, 2023 13:03
@hcfw007 hcfw007 requested a review from huan May 24, 2023 13:03
huan
huan previously approved these changes May 24, 2023
Copy link
Member

@huan huan left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you very much for adding the i18n solution to our docs!

@huan
Copy link
Member

huan commented May 24, 2023

copilot:all

@huan huan enabled auto-merge (squash) May 24, 2023 14:45
@huan
Copy link
Member

huan commented May 24, 2023

This PR will be good to go after the CI has turned green. Thanks!

@hcfw007
Copy link
Member Author

hcfw007 commented May 25, 2023

This CI error never occur in my local env. In local there is lots of network issue which make it hard to debug. I'll see what I can do.

[ERROR] Error: request to https://cdn.jsdelivr.net/npm/wechaty-grpc@next/dist/esm/out/wechaty/puppet.swagger.json failed, reason: read ECONNRESET
at BaseResolver. (/Users/myonlystarcn/LocalDocuments/code/work/other/wechaty-homepage-doc/docusaurus/node_modules/redoc/node_modules/@redocly/openapi-core/lib/resolve.js:119:23)
at Generator.throw ()
at rejected (/Users/myonlystarcn/LocalDocuments/code/work/other/wechaty-homepage-doc/docusaurus/node_modules/redoc/node_modules/@redocly/openapi-core/lib/resolve.js:6:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

@huan
Copy link
Member

huan commented May 26, 2023

As my investigation, the CI error is the following:

Warning:  Duplicate routes found!
- Attempting to create page at /zh/search, but a page already exists at this route.
This could lead to non-deterministic routing behavior.
[info] [webpackbar] Compiling Client
[info] [webpackbar] Compiling Server
[success] [webpackbar] Client: Compiled successfully in 1.[63](https://github.com/wechaty/docusaurus/actions/runs/5069018602/jobs/9102050392#step:7:64)m
[success] [webpackbar] Server: Compiled successfully in 2.00m
[info] [webpackbar] Compiling Service Worker
Error:  Unable to build website for locale zh.
Error:  Error: The route must start with the baseUrl "/zh/", but was "/qrcode/*". This is a bug, please report it.

Which is related to the duplicated routes, and the URL conflict problems.

auto-merge was automatically disabled June 1, 2023 04:02

Head branch was pushed to by a user without write access

@hcfw007
Copy link
Member Author

hcfw007 commented Jun 1, 2023

@huan I have fixed CI. This is due to the qrcode directly add route. When i18n cames in, it checks the base url.
According to this issue facebook/docusaurus#5844

However, when creating alternate URLs, the theme assumes that every page would have a localized base URL (which makes sense!)

Copy link
Member

@windmemory windmemory left a comment

Choose a reason for hiding this comment

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

LGTM

@hcfw007 hcfw007 requested a review from huan June 1, 2023 06:56
Copy link
Member

@huan huan left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you very much for adding i18n support to our docs website, and make the CI green!

@huan huan merged commit a105f22 into wechaty:main Jun 1, 2023
@hcfw007 hcfw007 deleted the feat/i18n-for-docs-wechaty branch June 1, 2023 08:56
@hcfw007
Copy link
Member Author

hcfw007 commented Jun 1, 2023

Great! Although we have only one page with Chinese version now, i'm looking forward to translate more.

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.

4 participants