-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
chore: add translation guide into contributing.md #1778
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
Merged
+30
−0
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,6 +109,36 @@ Unit tests are located inside `__tests__`. Consult the [Jest docs](https://jestj | |
| - Write a unit test whenever possible | ||
| - If a test is specific to a browser, create an e2e (end to end) test and make sure to indicate it on the test | ||
|
|
||
| ## Contributing Docs | ||
|
|
||
| Currently, all the docs can be found in `packages/docs`. It has a English version by default, and translation(s) in corresponding `<lang>` sub-folder(s): | ||
|
|
||
| - `zh`: Chinese translation. | ||
|
||
|
|
||
| Besides that, the `.vitepress` sub-folder is used to put the config and theme, including the i18n information. | ||
|
|
||
| If you want to start to translate the docs in a new language: | ||
Jinjiang marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 1. Create the corresponding `<lang>` sub-folder for your translation. | ||
| 2. Modify the i18n config in `.vitepress` sub-folder. | ||
| 3. Translate the docs and run the doc site to self-test locally. | ||
| 4. Once you have done all above, create a pull request to our GitHub repo. | ||
|
|
||
| If you want to maintain a existing translation: | ||
|
|
||
| 1. (Repo permission required) First of all, make sure there is a _checkpoint_ branch for the language. Usually it's named as `docs-sync-<lang>`. Notice that: | ||
| - This branch is always synced to the commit of the original docs that the latest translation of your language is corresponding to. Like `docs-sync-zh` is always to the commit of the original docs that the latest Chinese translation is corresponding to. | ||
| - Technically, this checkpoint branch should be only updated if the translation is synced to a nearer commit of the original docs. Usually the commit is the HEAD of the `main` branch at that moment. | ||
| 2. See what translation you need to do to sync up with the original docs. There are 2 popular ways: | ||
| - Git diff command: e.g. `git diff docs-sync-zh..main packages/docs # > debug.log`, or | ||
| - GitHub Compare page: e.g. https://github.com/vuejs/router/compare/docs-sync-zh...main (only see the changes in `packages/docs/*`) | ||
| 3. Create your own branch and start the translation update, following the diff or compare. | ||
| 4. Once you have done all above, create a pull request to our GitHub repo. | ||
| - It's highly recommended to commit with message like `docs(<lang>): sync update to <the-latest-commit>`. e.g. `docs(zh): sync update to e008551`. | ||
| 5. (Repo permission required) **VERY IMPORTANT**: after the pull request is merged, for the future batch of sync-up, do another merge from the latest commit at that moment to the checkpoint branch. e.g. merge commit `e008551` to branch `docs-sync-zh`. | ||
|
|
||
| For more real examples, please check out [all the PRs with title "docs(zh): sync" after 2023-01-01](https://github.com/vuejs/router/pulls?q=is%3Apr+created%3A%3E2023-01-01+docs%28zh%29+sync). | ||
|
|
||
| ## Credits | ||
|
|
||
| Thank you to all the people who have already contributed to Vue Router! | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.