mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 12:48:53 +08:00
New Crowdin translations - zh-CN (#24679)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
co-authored by
Crowdin Bot
parent
c0bb482126
commit
ed0c8eff7b
+50
-22
@@ -16,7 +16,7 @@ Simple changes to _existing content_ can be made by clicking the **Edit on GitHu
|
||||
|
||||

|
||||
|
||||
The guide uses the <a href="https://www.gitbook.com/about">Gitbook</a> toolchain. Change requests can be either done on the Gitbook website using the <a href="https://gitbookio.gitbooks.io/documentation/content/editor/index.html">Gitbook editor</a> or locally (more flexible, but less user-friendly).
|
||||
To edit an existing English page:
|
||||
|
||||
1. Open the page.
|
||||
2. Click the **Edit on GitHub** link below the page content.
|
||||
@@ -25,19 +25,32 @@ The guide uses the <a href="https://www.gitbook.com/about">Gitbook</a> toolchain
|
||||
|
||||
The documentation team will review the request and either merge it or work with you to update it.
|
||||
|
||||
## Adding New Content - Big Changes
|
||||
Note that you can only make changes to the English version directly in the source.
|
||||
[Translations are handled in Crowdin](../contribute/translation.md).
|
||||
|
||||
## Changes using Git
|
||||
|
||||
More substantial changes, including adding new pages or adding/modifying images, aren't as easy to make (or properly test) on Github.
|
||||
|
||||
For these kinds of changes we suggest using the same approach as for _code_:
|
||||
|
||||
1. Use the _git_ toolchain to get the documentation source code onto your local computer.
|
||||
1. Use the _git_ toolchain to get the PX4 source code onto your local computer.
|
||||
2. Modify the documentation as needed (add, change, delete).
|
||||
3. _Test_ that it builds properly using Vitepress.
|
||||
4. In order to contribute many changes to the documentation, it is recommended that you follow these steps to add the changes locally and then create a pull request:
|
||||
4. Create a branch for your changes and create a pull request (PR) to pull it back into the [PX4-Autopilot](https://github.com/PX4/PX4-Autopilot.git) repo.
|
||||
|
||||
The following explain how to get the source code, build locally (to test), and modify the code.
|
||||
|
||||
### What Goes Where?
|
||||
### Get Documentation Source Code
|
||||
|
||||
Documentation sources are in the [PX4-Autopilot](https://github.com/PX4/PX4-Autopilot/) repo, alongside all the other PX4 source code.
|
||||
The sources are markdown files located the [/docs](https://github.com/PX4/PX4-Autopilot/tree/main/docs) subdirectory.
|
||||
The English source files are in the [/docs/en/](https://github.com/PX4/PX4-Autopilot/tree/main/docs/en) subdirectory and can be edited directly.
|
||||
[Translation](../contribute/translation.md) sources are in language specific subdirectories, such as `ko` for korean and `zh` for Chinese: these are edited via the Crowdin tool, and should not be edited directly.
|
||||
|
||||
:::tip
|
||||
If you already have a clone of the [PX4-Autopilot](https://github.com/PX4/PX4-Autopilot/) you can ignore this section.
|
||||
:::
|
||||
|
||||
指南使用 <a href="https://legacy.gitbook.com/">旧版Gitbook 工具链</a>
|
||||
The instructions below explain how to get git and use it on your local computer.
|
||||
@@ -46,31 +59,31 @@ The instructions below explain how to get git and use it on your local computer.
|
||||
|
||||
2. [Sign up](https://github.com/join) for Github if you haven't already
|
||||
|
||||
3. Create a copy (Fork) of the [PX4 User Guide repo](https://github.com/PX4/PX4-user_guide) on Github ([instructions here](https://docs.github.com/en/get-started/quickstart/fork-a-repo)).
|
||||
3. Create a copy (Fork) of the [PX4-Autopilot repo](https://github.com/PX4/PX4-Autopilot) on Github ([instructions here](https://docs.github.com/en/get-started/quickstart/fork-a-repo)).
|
||||
|
||||
4. Clone (copy) your forked repository to your local computer:
|
||||
|
||||
```sh
|
||||
cd ~/wherever/
|
||||
git clone https://github.com/<your git name>/PX4-user_guide.git
|
||||
git clone https://github.com/<your git name>/PX4-Autopilot.git
|
||||
```
|
||||
|
||||
For example, to clone the PX4 userguide fork for a user with Github account "john_citizen":
|
||||
For example, to clone PX4 source fork for a user with Github account "john_citizen":
|
||||
|
||||
```sh
|
||||
git clone https://github.com/john_citizen/PX4-user_guide.git
|
||||
git clone https://github.com/john_citizen/PX4-Autopilot.git
|
||||
```
|
||||
|
||||
5. Navigate to your local repository:
|
||||
|
||||
```sh
|
||||
cd ~/wherever/PX4-user_guide
|
||||
cd ~/wherever/PX4-Autopilot
|
||||
```
|
||||
|
||||
6. Add a _remote_ called "upstream" to point to the PX4 version of the library:
|
||||
6. Add a _remote_ called "upstream" to point to the "official" PX4 version of the library:
|
||||
|
||||
```sh
|
||||
git remote add upstream https://github.com/PX4/PX4-user_guide.git
|
||||
git remote add upstream https://github.com/PX4/PX4-Autopilot.git
|
||||
```
|
||||
|
||||
:::tip
|
||||
@@ -80,7 +93,19 @@ The instructions below explain how to get git and use it on your local computer.
|
||||
|
||||
:::
|
||||
|
||||
7. Create a branch for your changes:
|
||||
### Make/Push Documentation Changes
|
||||
|
||||
Within the repository you created above:
|
||||
|
||||
1. Bring your copy of the repository `main` branch up to date:
|
||||
|
||||
```sh
|
||||
git checkout main
|
||||
git fetch upstream main
|
||||
git pull upstream main
|
||||
```
|
||||
|
||||
2. Create a new branch for your changes:
|
||||
|
||||
```sh
|
||||
git checkout -b <your_feature_branch_name>
|
||||
@@ -88,9 +113,9 @@ The instructions below explain how to get git and use it on your local computer.
|
||||
|
||||
This creates a local branch on your computer named `your_feature_branch_name`.
|
||||
|
||||
8. Make changes to the documentation as needed (general guidance on this in following sections)
|
||||
3. Make changes to the documentation as needed (general guidance on this in following sections)
|
||||
|
||||
9. Once you are satisfied with your changes, you can add them to your local branch using a "commit":
|
||||
4. Once you are satisfied with your changes, you can add them to your local branch using a "commit":
|
||||
|
||||
```sh
|
||||
git add <file name>
|
||||
@@ -99,23 +124,26 @@ The instructions below explain how to get git and use it on your local computer.
|
||||
|
||||
For a good commit message, please refer to the [Source Code Management](../contribute/code.md#commits-and-commit-messages) section.
|
||||
|
||||
10. Push your local branch (including commits added to it) to your forked repository on Github.
|
||||
5. Push your local branch (including commits added to it) to your forked repository on Github.
|
||||
|
||||
```sh
|
||||
git push origin your_feature_branch_name
|
||||
```
|
||||
|
||||
11. Go to your forked repository on Github in a web browser, e.g.: `https://github.com/<your git name>/PX4-user_guide.git`.
|
||||
6. Go to your forked repository on Github in a web browser, e.g.: `https://github.com/<your git name>/PX4-Autopilot.git`.
|
||||
There you should see the message that a new branch has been pushed to your forked repository.
|
||||
|
||||
12. Create a pull request (PR):
|
||||
7. Create a pull request (PR):
|
||||
|
||||
- On the right hand side of the "new branch message" (see one step before), you should see a green button saying "Compare & Create Pull Request".
|
||||
Press it.
|
||||
- A pull request template will be created.
|
||||
It will list your commits and you can (must) add a meaningful title (in case of a one commit PR, it's usually the commit message) and message (<span style="color:orange">explain what you did for what reason</span>.
|
||||
Check [other pull requests](https://github.com/PX4/PX4-user_guide/pulls) for comparison)
|
||||
Check [other pull requests](https://github.com/PX4/PX4-Autopilot/pulls) for comparison).
|
||||
- Add the "Documentation" label.
|
||||
|
||||
8. You're done!
|
||||
|
||||
13. You're done!
|
||||
Maintainers for the PX4 User Guide will now have a look at your contribution and decide if they want to integrate it.
|
||||
Check if they have questions on your changes every once in a while.
|
||||
|
||||
@@ -128,10 +156,10 @@ The instructions below explain how to get git and use it on your local computer.
|
||||
- [Nodejs 18+](https://nodejs.org/en)
|
||||
- [Yarn classic](https://classic.yarnpkg.com/en/docs/install)
|
||||
|
||||
2. Navigate to your local repository:
|
||||
2. Navigate to your local repository and the `/docs` subdirectory:
|
||||
|
||||
```sh
|
||||
cd ~/wherever/PX4-user_guide
|
||||
cd ~/wherever/PX4-Autopilot/docs
|
||||
```
|
||||
|
||||
3. Install dependencies (including Vitepress):
|
||||
|
||||
Reference in New Issue
Block a user