Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 1.45 KB

TRANSLATING.md

File metadata and controls

52 lines (34 loc) · 1.45 KB

Translation Guidelines

The Walrus documentation uses mdbook-i18n-helpers as a translation framework.

Preparation

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 file for the detailed usage of mdbook-i18n-helpers. We summarize the most important commands below.

Generating a message template

The generated message template po/messages.pot is required to create or update translations.

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

Creating a new translation resource

In the following, replace xx by the ISO 639 language code.

msginit -i po/messages.pot -l xx -o po/xx.po

Updating an existing translation resource

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.

MDBOOK_BOOK__LANGUAGE=xx mdbook build
MDBOOK_BOOK__LANGUAGE=xx mdbook serve