The manual supports implementation recommendations for internationalization

Hello! Two weeks have passed since I proposed the Establishment of Chinese Language Manual

Thanks all for your support and suggestions, I finally found a way to synchronously generate multilingual manuals without changing the structure of the original manuals. We might be able to take advantage of Sphinx’s nationalization support, and I’ve been testing Chinese document generation on a copy of the TVM project, and it works fine.

Here gives the example:

  • First I want to present the schematic, which is from official website of Sphinx.

    sorry, I don’t have privileges to give more than one image in a topic, so i will give it in comments section

  • In the example above, I have translated only one file (*.po), which reads as follows:

# ...

#: ../../_staging/index.rst:21
msgid ""
"TVM is an open deep learning compiler stack for CPUs, GPUs, and "
"specialized accelerators. It aims to close the gap between the "
"productivity-focused deep learning frameworks, and the performance- or "
"efficiency-oriented hardware backends."
msgstr ""
"Apache TVM是用于深度学习系统的编译器堆栈。它旨在缩小以生产力为中心的深度学习框架与以性能和效率为中心的硬件后端之间的差距。TVM与深度学习框架配合使用,为不同的后端提供端到端编译。"

#: ../../_staging/index.rst:25
msgid "Get Started"
msgstr "开始吧!"

#: ../../_staging/index.rst:27
msgid "Follow the :doc:`instructions <install/index>` to install TVM."
msgstr "依据 :doc:`介绍 <install/index>` 来安装TVM"

# ...

# msgid gives the source document, which is generate automatically
# msgstr gives the aim document, we work here!
  • Finally, I gives the change to the source code and TVM website-code generate process:
  1. add code to docs/conf.py
    # I put them to line 54-55.
    locale_dirs = ['locale/']   
    gettext_compact = False  
    
  2. generate gettext
    cd docs/
    make -j20 gettext
    
    # you will find a fold named "locale" generated in docs/_build/ 
    
  3. create .po文件
    cd docs/_staging/
    sphinx-intl update -p _build/locale/ -l zh_CN -l en   # It will set up internationalization support for English and Chinese
    
    # then docs/_staging/locale will be generated. For the Chinese manual, we only need to translate docs/_staging/locale/zh_CN/LC_MESSAGES/*.po
    # Of course, when run "make clean", the locale should not be delete. 
    
  4. generate static-website-code for multi-language (Chinese for example):
    make -e  SPHINXOPTS="-D language='zh_CN'" html 
    
    # the fold "html", written in Chinese, will be generated in docs/_build/. We can deploy it normally
    

What’s more, co-translation can be performed using transifex, which provides a good division of work between translators and reviewers. I only test the service from transifex.com, but it comes at a high cost. It seems that transifex is an open-source-software? Can we deploy it and work on it?

We look forward to the preparation of the Chinese handbook as soon as possible, and look forward to the official response and your participation.

(We have already contacted some people working on the Chinese manual, if you are interested, please join us or guide us. Group entry will be given in the comments section)

3 Likes

schematic:

Group entry:

@tqchen @hogepodge Hey I would love to ask about our policy on hosting internationalized documents? Shall we use https://github.com/apache/tvm-site?

Feel free to start with a separate place then we can look into bring things back to official once it gets into a good shape, at that point we can simply bring to tvm-site(note the content is still generated elsewhere but can be populated here via s script).

@tqchen what do you think about linking out to the internationalized documents from the tvm main site for now?

Also, fwiw I’m working up a pull request for the new docs rfc. There will be a lot of moving parts in the coming weeks, so immediate action may not be possible until that dust settles.

we can certainly do that as well(as long as we made clear these are good thirdparty community effort for now)

Good news, we have start our work. Welcome to join us.

Join us and Complete translation of Chinese manual

and the Slack that you mentioned earlier was created, share-link: https://join.slack.com/t/slack-4xv5706/shared_invite/zt-vwekxs1y-q8rFdwCPvlCpr7K90X8tRw