You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/02/15 10:24:21 UTC

[GitHub] [tvm] oneflyingfish opened a new pull request #10249: Implementation of TVM international manual generation and automatic translation deployment

oneflyingfish opened a new pull request #10249:
URL: https://github.com/apache/tvm/pull/10249


   Based on the submitted code, we can quickly and easily generate multilingual documents for TVM and even automatically connect to transifex.com, a well-known collaborative translation platform.
   
   we have successfully deployed [a project for Chinese documentation](https://github.com/TVMChinese/tvm). For more information, view the following [repositories](https://github.com/TVMChinese) directly, and this mentioned project is complete and has been deployed on the [website](https://chinese.tvm.wiki/), and our international translation is performed via transifex.com.
   
   0. The following work was done in the following environment:
   
      * os: https://hub.docker.com/r/tlcpack/ci-gpu
      * tx-version: 0.14.3, py 3.6, x86_64
   
   1. Based on the previous information, prepare the basic environment to ensure that English documents can be generated normally.
   
   2. create gettext fold, where store the `*.pot` and `*.po` files. An automated script has been provided and you can do this easily.
   
      ```bash
      cd docs/
      ../tests/scripts/task_python_generate_documents.sh true true false <language>
   
      # for example:
      ../tests/scripts/task_python_generate_documents.sh true true false zh_CN   # for Simplified Chinese, You can find out how to use it at the end of the document.
      ```
   
      The following types of `language` are supported:
   
      * bn – Bengali
      * ca – Catalan
      * cs – Czech
      * da – Danish
      * de – German
      * en – English
      * es – Spanish
      * fi – Finnish
      * fr – French
      * hr – Croatian
      * it – Italian
      * lt – Lithuanian
      * nl – Dutch
      * pl – Polish
      * pt_BR – Brazilian Portuguese
      * ru – Russian
      * sl – Slovenian
      * sv – Swedish
      * tr – Turkish
      * uk_UA – Ukrainian
      * zh_CN – Simplified Chinese
      * zh_TW – Traditional Chinese
   
   3. Translate documents directly by translating <*.po>, which is not recommended. We suggest a professional translation platform to implement multi-person collaborative translate-review. If you agree with our advice, you can skip this step. We will use <transifex.com> as an example to tell you how to deploy it.
      
      you can try to translate *.po in `translates/locales/<language>/LC_MESSAGES/`. Notice that `_staging/translates/locales` in fact is a soft-chain to `translates/locales`.
   
   4. Implement cooperative translation of <*.po> with the help of `transifex.com`. An automated script is also provided to help you simplify operations.
   
      a. config the parameters in `docs/tx_transifex.sh` firstly.
   
         ```bash
         POTDIR="translates/gettext"                  # the *.pot fold. If you are not sure, default is recommended
         LOCALESDIR="translates/locales"              # the *.po fold, it can be unexist. If you are not sure, default is recommended
         URLNAME=""                                   # you can find it in your project in transifex.com, the same as the share-URL suffix.
         LANGUAGE=""                                  # the target language, "zh_CN" (Simplified Chinese) for example
         ```
   
      b. init your transifex identity
   
         ```bash
         cd docs/
         ./tx_transifex.sh init                       # Please feel relaxed to kill the process(Ctrl^C) after input API token and finish verification.
         ```
   
      c. update your transifex-config, which record the relation between `*.pot` and `*.po`
   
         ```bash
         cd docs/
         ../tests/scripts/task_python_generate_documents.sh true true false <language>   # update your gettext(*.pot)
   
         ./tx_transifex.sh update                                                   # update transifex-config
         ```
   
      d. push your changes to transifex.com
   
         ```bash
         cd docs/
         ./tx_transifex.sh push
         ```
   
      e. pull the translated-po files to locale
   
         ```bash
         cd docs/
         ./tx_transifex.sh pull
         ```
   
   5. generate the html for Chinese.
   
      We will automatically generate the sitemap(`$DOCS/_build/html_$LANGUAGE/*sitemap.xml`) for you, which is necessary if you expect your site to be detected by search engines like google.  We need you to specify the `ROOTURL` value in `docs/sitemaps/sitemap_generator/config.py`, which represents the url corresponding to the root of the website. If this is not helpful to you, you can skip this step. The default sitemap will still be generated, but it may not be valid.
   
      ```bash
      cd docs/
      ../tests/scripts/task_python_generate_documents.sh false false true <language> # the _build/html_zh_CN will be created. you can directly deploy to your website.
      ```
   
   6. some tips
   
      If you are just updating the translation, do the following is enough:
   
      ```bash
      cd docs/
      ./tx_transifex.sh pull  # if you use <transifex.com> and do translation work remotely, or you can skip this command
      ../tests/scripts/task_python_generate_documents.sh false false true <language>
      ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] oneflyingfish commented on pull request #10249: Implementation of TVM international manual generation and automatic translation deployment

Posted by GitBox <gi...@apache.org>.
oneflyingfish commented on pull request #10249:
URL: https://github.com/apache/tvm/pull/10249#issuecomment-1045611063


   Thank you for your advice


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] oneflyingfish commented on pull request #10249: Implementation of TVM international manual generation and automatic translation deployment

Posted by GitBox <gi...@apache.org>.
oneflyingfish commented on pull request #10249:
URL: https://github.com/apache/tvm/pull/10249#issuecomment-1045587089


   Thank you for your advice, I benefited a lot.  Because the content of the code was originally for [Chinese manual](https://github.com/TVMChinese/tvm) this particular project work, later try to separate the core code, so will still have a lot of shortcomings.  On the other hand, I lack some experience and need your advice.
   
   There is no doubt that Sphinx-Sitemap is a helpful project and I will try to integrate it.  On the other hand, environment setup and installation can indicate dependencies directly through documentation, rather than adding them to automated scripts, while adding items to Dockerfiles.  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] oneflyingfish closed pull request #10249: Implementation of TVM international manual generation and automatic translation deployment

Posted by GitBox <gi...@apache.org>.
oneflyingfish closed pull request #10249:
URL: https://github.com/apache/tvm/pull/10249


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] hogepodge commented on pull request #10249: Implementation of TVM international manual generation and automatic translation deployment

Posted by GitBox <gi...@apache.org>.
hogepodge commented on pull request #10249:
URL: https://github.com/apache/tvm/pull/10249#issuecomment-1045455655


   I've started to build this and have a few comments on things I've noticed. The script makes some assumptions about how dependencies are installed, and calls `pip` to bring in `doctools` and `sphinx-intl`. Since there are many different ways people work with and develop TVM, I would argue that the build script should not handle installation of dependencies, rather that should be defined as a prerequisite and left to the user or build system to sort out. 
   
   Speaking more generally we should be more explicit on what configurations and prerequisites need to be set and installed for a successful docs build. For some docs we need to enable `microtvm`, or have libraries like `tensorflow`, `pytorch`, and `clang` be available for a successful build. These aren't issues with this patch in general, just with the docs build in general.
   
   Noting that some work has gone into sitemap generation, is this something that can be separated out as a side improvement?
   
   I'd like to see a specific doc added that has links to translations and also adds world-facing instructions on how to add a translation. This work deserves more visibility.
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] jroesch commented on pull request #10249: Implementation of TVM international manual generation and automatic translation deployment

Posted by GitBox <gi...@apache.org>.
jroesch commented on pull request #10249:
URL: https://github.com/apache/tvm/pull/10249#issuecomment-1043455682


   Thanks so much for the contribution! could folks who have been owning documentation tools review this one @driazati @hogepodge? cc @junrushao1994 @masahi 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] driazati commented on pull request #10249: Implementation of TVM international manual generation and automatic translation deployment

Posted by GitBox <gi...@apache.org>.
driazati commented on pull request #10249:
URL: https://github.com/apache/tvm/pull/10249#issuecomment-1045485211


   This is awesome work! Internationalizing docs is great for the project. It'd be nice to see multilingual options eventually integrated on the main tvm docs website.
   
   For dependencies we should add what we can do the `ci-gpu` docker image (which our Jenkins CI uses to build the docs). I also wonder if https://github.com/jdillard/sphinx-sitemap would help with generating the sitemap without having to maintain any custom code


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org