mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-04-21 23:45:42 +02:00
Build translations from mdbook-i18-helpers
This commit is contained in:
parent
cc0a78ed9a
commit
d3db8e6108
14
.github/workflows/publish.yml
vendored
14
.github/workflows/publish.yml
vendored
@ -41,19 +41,7 @@ jobs:
|
|||||||
run: mdbook build -d book
|
run: mdbook build -d book
|
||||||
|
|
||||||
- name: Zip exercise templates
|
- name: Zip exercise templates
|
||||||
run: cd book/exerciser && zip --recurse-paths ../html/comprehensive-rust-exercises.zip comprehensive-rust-exercises/
|
run: cd book && find . -name "exerciser" -type d -exec bash -c 'zip --recurse-paths ./html/$(dirname {})/comprehensive-rust-exercises.zip {}/comprehensive-rust-exercises/' \;
|
||||||
|
|
||||||
- name: Build all translations
|
|
||||||
run: |
|
|
||||||
for po_lang in ${{ env.LANGUAGES }}; do
|
|
||||||
echo "::group::Building $po_lang translation"
|
|
||||||
MDBOOK_BOOK__LANGUAGE=$po_lang \
|
|
||||||
MDBOOK_OUTPUT__HTML__SITE_URL=/comprehensive-rust/$po_lang/ \
|
|
||||||
mdbook build -d book/$po_lang
|
|
||||||
(cd book/$po_lang/exerciser && zip --recurse-paths ../html/comprehensive-rust-exercises.zip comprehensive-rust-exercises/)
|
|
||||||
mv book/$po_lang/html book/html/$po_lang
|
|
||||||
echo "::endgroup::"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
uses: actions/configure-pages@v2
|
uses: actions/configure-pages@v2
|
||||||
|
11
book.toml
11
book.toml
@ -88,3 +88,14 @@ line-numbers = true
|
|||||||
|
|
||||||
[output.exerciser]
|
[output.exerciser]
|
||||||
output-directory = "comprehensive-rust-exercises"
|
output-directory = "comprehensive-rust-exercises"
|
||||||
|
|
||||||
|
[output.i18n-helpers]
|
||||||
|
default_language = "en"
|
||||||
|
translate_all_languages = true
|
||||||
|
move_translations_to_html_directory = true
|
||||||
|
|
||||||
|
[output.i18n-helpers.languages]
|
||||||
|
"en" = "English"
|
||||||
|
"es" = "Spanish (Español)"
|
||||||
|
"ko" = "Korean (한국어)"
|
||||||
|
"pt-BR" = "Brazilian Portuguese (Português do Brasil)"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user