diff --git a/README.md b/README.md index 03b602361c..f2b2a9243c 100644 --- a/README.md +++ b/README.md @@ -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.)