Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and pull translation from transifex #440

Closed
fffx opened this issue Jun 20, 2023 · 1 comment
Closed

Build and pull translation from transifex #440

fffx opened this issue Jun 20, 2023 · 1 comment

Comments

@fffx
Copy link

fffx commented Jun 20, 2023

Hi, I built the book to zh_CN HTML, but the language is still English in _build_zh_CN/html/index.html, what else do I need to configure for pulling translation from Transifex?

❯ docker run --rm -it -v "$(realpath .)":/repo -u "$(id -u)" a1803 ./make-lang zh_CN html

make: Entering directory '/repo'
make -C src/ -f Makefile.assets
make[1]: Entering directory '/repo/src'
make[1]: Nothing to be done for 'assets'.
make[1]: Leaving directory '/repo/src'
Running Sphinx v4.3.2
loading translations [zh_CN]... not available for built-in messages
making output directory... done
checking bibtex cache... out of date
parsing bibtex file /repo/src/Crypto101.bib... parsed 47 entries
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 20 source files that are out of date
updating environment: [new config] 20 added, 0 changed, 0 removed
reading sources... [100%] zreferences
/repo/src/stream-ciphers.rst:281: WARNING: Unexpected indentation.
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] zreferences
generating indices... genindex done
writing additional pages... search done
copying images... [100%] Illustrations/CTR/CTR.svg
copying static files... done
copying extra files... done
dumping search index in Chinese (code: zh)... done
dumping object inventory... done
build succeeded, 1 warning.

The HTML pages are in _build_zh_CN/html.
make: Leaving directory '/repo'
❯ open _build_zh_CN/html/index.html

By the way:
the crypto101 image is missing from docker hub, I built it by myself

@fffx
Copy link
Author

fffx commented Jun 20, 2023

Figured it out:

  1. install Transifex client from https://github.com/transifex/cli
  2. run tx migrate
  3. make tx_pull
  4. run with zh instead of zh_CN, which is available in src/locales
 docker run --rm -it -v "$(realpath .)":/repo -u "$(id -u)" a1803 ./make-lang zh html

@fffx fffx closed this as completed Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant