Translation

For more information, please refer to

Prerequests

Init

  1. init po

    just book_init xx
    
  2. add language select button

    file: ./book/theme/index.hbs

     <ul id="language-list" class="theme-popup" aria-label="Languages" role="menu">
         <li role="none"><button role="menuitem" class="theme"><a id="en">English</a></button></li>
    +    <li role="none"><button role="menuitem" class="theme"><a id="xx">Some Language</a></button></li>
     </ul>
    
  3. update github action

    file: .github/workflows/gh-pages.yaml

     env:
         CARGO_TERM_COLOR: always
         # Update the language picker in index.hbs to link new languages.
    -    LANGUAGES: zh
    +    LANGUAGES: zh xx
    

Build

just book_build xx

Serve

just book_serve xx

Update po

just book_update xx

Serve all languages

  1. build all languages

    just book_build_all
    
  2. you may need a http server like TheWaWaR/simple-http-server

    simple-http-server -- ./book/book