Skip to content

Commit

Permalink
Provide more detailed translation instructions (ordinals#2443)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrJingLee authored Sep 10, 2023
1 parent a6d4433 commit f53bc8c
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,47 @@ There are some other things to watch out for but feel free to just start a
translation and open a PR. Have a look at [this commit](https://github.com/ordinals/ord/commit/329f31bf6dac207dad001507dd6f18c87fdef355)
for an idea of what to do. A maintainer will also help you integrate it into our
build system.

To align your translated version of the Handbook with reference to commit
[#2427](https://github.com/ordinals/ord/pull/2426), here are some guiding
commands to assist you. It is assumed that your local environment is already
well-configured with [Python](https://www.python.org/),
[Mdbook](https://github.com/rust-lang/mdBook),
[mdBook i18n helper](https://github.com/rust-lang/mdbb) and that you've clone
this repo.


1. Run the following command to generate a new `pot` file, which is named as
`messages.pot`:

```
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}'
mdbook build -d po
```

2. Run `msgmerge` where `xx.po` is your localized language version following
the naming standard of [ISO639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
This process will update the `po` file with the most recent original version:

```
msgmerge --update po/xx.po po/messages.pot
```

3. Look for `#, fuzzy`. The `mdBook-i18n-helper` tool utilizes the `"fuzzy"` tag
to highlight sections that have been recently edited. You can proceed to perform
the translation tasks by editing the `"fuzzy"`part.

4. Execute the `mdbook` command. A demonstration in Chinese (`zh`) is given below:

```
mdbook build docs -d build
MDBOOK_BOOK__LANGUAGE=zh mdbook build docs -d build/zh
mv docs/build/zh/html docs/build/html/zh
python3 -m http.server --directory docs/build/html --bind 127.0.0.1 8080
```

6. Upon verifying everything and ensuring all is in order, you can commit the
modifications and progress to open a Pull Request (PR) on Github.
(**Note**: Please ensure **ONLY** the **'xx.po'** file is pushed, other files
such as '.pot' or files ending in '~' are **unnecessary** and should **NOT** be
included in the Pull Request.)

0 comments on commit f53bc8c

Please sign in to comment.