forked from MystenLabs/walrus-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from lispking/main
feat: 翻译中文,用i18n-helpers优雅的翻译完第一版
- Loading branch information
Showing
13 changed files
with
18,328 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -18,9 +18,19 @@ You can also build and access the documentation locally (assuming you have Rust | |
cargo install mdbook | ||
cargo install [email protected] --locked | ||
cargo install [email protected] --locked | ||
cargo install mdbook-i18n-helpers --locked | ||
mdbook serve | ||
``` | ||
|
||
### Using translated version | ||
|
||
If there is a translated resource in `po/` directory, it can be specified through `MDBOOK_BOOK__LANGUAGE` like below: | ||
|
||
```bash | ||
MDBOOK_BOOK__LANGUAGE=zh_CN mdbook build | ||
MDBOOK_BOOK__LANGUAGE=zh_CN mdbook serve | ||
``` | ||
|
||
## Get help and report issues | ||
|
||
If you have general questions or require help on how to use Walrus, please check for [existing | ||
|
This file contains 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Translation Guidelines | ||
|
||
## Translation workflow | ||
|
||
### Preparation | ||
|
||
RBE uses [mdbook-i18n-helpers](https://github.com/google/mdbook-i18n-helpers) as a translation framework. | ||
The following tools are required. | ||
|
||
* GNU gettext utilities ( `msgmerge` and `msgcat` ) | ||
* mdbook-i18n-helpers ( `cargo install mdbook-i18n-helpers` ) | ||
|
||
### Creating and Updating Translations | ||
|
||
Please see the [mdbook-i18n-helpers USAGE](https://github.com/google/mdbook-i18n-helpers/blob/main/i18n-helpers/USAGE.md) file for the detailed usage of mdbook-i18n-helpers. | ||
The summarized command list is below: | ||
|
||
#### Generating a message template | ||
|
||
The generated message templete `po/messages.pot` is required to create or update translations. | ||
|
||
```bash | ||
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}' \ | ||
mdbook build -d po | ||
``` | ||
|
||
#### Creating a new translation resource | ||
|
||
`xx` is [ISO 639](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. | ||
|
||
```bash | ||
msginit -i po/messages.pot -l xx -o po/xx.po | ||
``` | ||
|
||
#### Updating the existing translation resource | ||
|
||
```bash | ||
msgmerge --update po/xx.po po/messages.pot | ||
``` | ||
|
||
### Editing translation resources | ||
|
||
After generating a translation resource `po/xx.po`, you can write translation messages in `msgstr` entry of `po/xx.po`. | ||
To build a translated book, the following command can be used. | ||
|
||
```bash | ||
MDBOOK_BOOK__LANGUAGE=xx mdbook build | ||
MDBOOK_BOOK__LANGUAGE=xx mdbook serve | ||
``` |
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
# Summary | ||
|
||
[Walrus](./README.md) | ||
[Walrus](./index.md) | ||
|
||
--- | ||
|
||
|
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
# Example Move package depending on Walrus | ||
|
||
A simple example of depending on the Walrus Testnet Move package. | ||
|
||
You can build, test, and publish this with the following commands (from this directory): | ||
|
||
```sh | ||
sui move build | ||
sui move test | ||
sui client publish --skip-dependency-verification | ||
``` |
Oops, something went wrong.