zotanika / tvmdoc.multilingual.io

TVM multilingual documentation
6 stars 2 forks source link

TVM Multilingual Documentation

Introduction

This project has been established to provide a workplace for TVM technical documentation localization. For now, primary target languages are Korean, Japanese, and Chinese(simplified).

Setup

Volunteers can immediately start translating just after cloning the project repository by:

$ git clone --recursive https://github.com/zotanika/tvmdoc.multilingual.io
$ cd ./tvmdoc.multilingual.io

Make sure if packages necessary for building TVM are installed in the system:

$ sudo apt-get update
$ sudo apt-get install -y python3 python3-dev python3-setuptools gcc libtinfo-dev zlib1g-dev build-essential cmake libedit-dev libxml2-dev llvm

Don't forget to take care of SSL certificate for accessing HTTPS sites through Python urllib if you are working behind a coperate proxy.

Advanced Setup

For your convenience, please prepare the virtual environment for keeping your workspace quarantined from the global system environment(limited to Linux environment):

$ virtualenv -p python3 ./venv
$ . ./venv/bin/activate
$ pip install -r requirements.txt

One more step will be required, to make HTML preview reflecting your efforts possible:

$ . makeready.sh

Target Files

Please check in PO(text based portable object) files from the directory ./locale/<lang>/LC_MESSAGES/. Simply, each translator can fill the blank msgstrs.

Language Working Directory
Korean ./locale/kr/LC_MESSAGES/
Japanese ./locale/ja/LC_MESSAGES/
Chinese(simplified) ./locale/zh_CN/LC_MESSAGES/

An example snippet in ./locale/<lang>/LC_MESSAGES/faq.po follows, where the msgid is multi-line text and contains reStructuredText syntax.

#: ../../faq.rst:31
msgid ""
"If the hardware backend has LLVM support, then we can directly generate "
"the code by setting the correct target triple as in "
":py:mod:`~tvm.target`."
msgstr ""
"<FILL HERE WITH TARGET LANGUAGE>"

For Korean,

#: ../../faq.rst:31
msgid ""
"If the hardware backend has LLVM support, then we can directly generate "
"the code by setting the correct target triple as in "
":py:mod:`~tvm.target`."
msgstr ""
"만일 타겟 하드웨어 백엔드가 LLVM을 지원한다면, :py:mod:`~tvm.target` 에 적절한 "
"타겟 트리플을 지정함으로써 곧바로 코드를 생성할 수 있습니다."

Further references could be found at SPHINX internationalization process.

HTML preview

Volunteers are able to preview how their translations appear in actual HTML pages by running:

Check out TVM upstream

In case that you would like to see what updates may be delivered from upstream TVM documentations, please run the script:

$ . upsync.sh

The process above will help you update and build the whole upstream TVM project, then generate latest PO files correspondingly. You can find the updated HTML artifacts at ./html-reference (in English).

HTML hosting(under construction)