File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 - main
77 pull_request :
88
9- env :
10- # Update the language picker in theme/js/language-picker.js to link new languages.
11- LANGUAGES : zh-TW
12-
139jobs :
1410 deploy :
1511 runs-on : ubuntu-24.04
3834 run : make prepare_i18n
3935
4036 - name : Build
41- # linkcheck causes ouput files to end up in html/, so move them to root
42- run : |
43- mdbook build
44- mv book/html/* book/
45-
46- - name : Build all translations
47- run : |
48- for po_lang in ${{ env.LANGUAGES }}; do
49- echo "::group::Building $po_lang translation"
50- MDBOOK_BOOK__LANGUAGE=$po_lang \
51- MDBOOK_OUTPUT__HTML__SITE_URL=/linuxboot-book/$po_lang/ \
52- mdbook build -d book/$po_lang
53- rsync -a book/$po_lang/html/ book/$po_lang/
54- rm -r book/$po_lang/html/
55- echo "::endgroup::"
56- done
37+ run : make build
5738
5839 - name : Deploy
5940 uses : peaceiris/actions-gh-pages@v3
Original file line number Diff line number Diff line change 1- build :
1+ build : book i18n
2+ # linkcheck causes output files to end up in html/, so move them to root
3+ mv book/html/* book/
4+
5+ i18n :
6+ bash i18n.sh
7+
8+ book :
29 mdbook build
310
411run :
Original file line number Diff line number Diff line change @@ -38,6 +38,16 @@ From the root directory of the repository run `mdl /src/example.md` and `vale
3838src/example.md`. Add words that trigger false positive spelling errors to
3939` ci/vale/styles/config/vocabularies/LinuxBoot/accept.txt ` .
4040
41+ ## I18n
42+
43+ Translations are in [ ` po/ ` ] ( po/ ) . They are built with [ ` i18n.sh ` ] ( i18n.sh ) .
44+ Until there is a native mdBook plugin, see the [ ` Makefile ` ] ( Makefile ) for how
45+ the translations are integrated.
46+
47+ Note that ` make run ` / ` mdbook serve ` do not integrate the translations at this
48+ point. The ` make build ` target will build everything into ` book/ ` , which you
49+ can then statically serve.
50+
4151## Acknowledgments
4252
4353In alphabetical order:
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # Update the language picker in theme/js/language-picker.js to add new languages.
4+ LANGUAGES=zh-TW
5+
6+ for po_lang in ${LANGUAGES} ; do
7+ echo " ::group::Building $po_lang translation"
8+ MDBOOK_BOOK__LANGUAGE=$po_lang \
9+ MDBOOK_OUTPUT__HTML__SITE_URL=/linuxboot-book/$po_lang / \
10+ mdbook build -d book/$po_lang
11+ # NOTE: This is crucial. Put the files in the right place.
12+ rsync -a book/$po_lang /html/ book/$po_lang /
13+ echo " ::endgroup::"
14+ done
You can’t perform that action at this time.
0 commit comments