diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1573c215a1f6..e5fb11a3e870 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,13 +23,13 @@ env: jobs: publish: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 +# with: + # We need the full history for the restore commands below. + # fetch-depth: 0 - name: Setup Rust cache uses: ./.github/workflows/setup-rust-cache @@ -47,8 +47,20 @@ jobs: run: | for po_lang in ${{ env.LANGUAGES }}; do echo "::group::Building $po_lang translation" + POT_CREATION_DATE=$(grep --max-count 1 '^"POT-Creation-Date:' po/$po_lang.po | sed -E 's/".*: (.*)\\n"/\1/') + if [[ $POT_CREATION_DATE == "" ]]; then + POT_CREATION_DATE=now + fi + echo "Building $po_lang translation as of $POT_CREATION_DATE" + rm -r src/ + git restore --source $(git rev-list -n 1 --before "$POT_CREATION_DATE" @) src/ + + # Set language and adjust URL. Clear the redirects since + # they are in sync with the source files, not the + # translation. MDBOOK_BOOK__LANGUAGE=$po_lang \ MDBOOK_OUTPUT__HTML__SITE_URL=/comprehensive-rust/$po_lang/ \ + MDBOOK_OUTPUT__HTML__REDIRECT='{}' \ 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 diff --git a/po/bn.po b/po/bn.po index a8b5b0e95bda..2add6465e942 100644 --- a/po/bn.po +++ b/po/bn.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-09-05\n" "PO-Revision-Date: \n" "Last-Translator: Md. Rasel Mandol \n" "Language-Team: noob_rasel\n" diff --git a/po/da.po b/po/da.po index 5c5bf87b0cbe..4299ec0e9480 100644 --- a/po/da.po +++ b/po/da.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-09-24\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" diff --git a/po/de.po b/po/de.po index b436cfde6afa..d58c03147c95 100644 --- a/po/de.po +++ b/po/de.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-09-19\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" diff --git a/po/el.po b/po/el.po index 960fe9e3db55..3d29c71ea232 100644 --- a/po/el.po +++ b/po/el.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-08-26\n" "PO-Revision-Date: 2023-08-25 13:24-0700\n" "Last-Translator: root \n" "Language-Team: Greek \n" diff --git a/po/es.po b/po/es.po index d16a4f55d1dd..ab9a3854aa81 100644 --- a/po/es.po +++ b/po/es.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-09-11\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" diff --git a/po/fa.po b/po/fa.po index cff0bae1ac8d..70c803c0befc 100644 --- a/po/fa.po +++ b/po/fa.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-08-23\n" "PO-Revision-Date: 2023-08-08 21:41+0330\n" "Last-Translator: danny \n" "Language-Team: Persian\n" diff --git a/po/fr.po b/po/fr.po index bd62dedb5e72..9f284dd99c78 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-09-17\n" "PO-Revision-Date: 2023-09-12 14:14-0400\n" "Last-Translator: Olivier Charrez \n" "Language-Team: French \n" diff --git a/po/id.po b/po/id.po index 0ad93c976edd..61da97053aff 100644 --- a/po/id.po +++ b/po/id.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-08-26\n" "PO-Revision-Date: 2023-08-25 14:03-0700\n" "Last-Translator: Aji Prio Sejati \n" "Language-Team: Indonesian \n" diff --git a/po/it.po b/po/it.po index c38bce1ae856..49e535fbba6c 100644 --- a/po/it.po +++ b/po/it.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-09-19\n" "PO-Revision-Date: 2023-09-19 09:35+0100\n" "Last-Translator: Ivan De Marino \n" "Language-Team: \n" diff --git a/po/ja.po b/po/ja.po index 365a13c590de..5570dcef304b 100644 --- a/po/ja.po +++ b/po/ja.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-09-24\n" "PO-Revision-Date: 2023-06-06 13:18+0900\n" "Last-Translator: Kenta Aratani \n" "Language-Team: Japanese \n" diff --git a/po/ko.po b/po/ko.po index 4ead7487e525..a7615cb65609 100644 --- a/po/ko.po +++ b/po/ko.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: [한국어]Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-09-24\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" diff --git a/po/pl.po b/po/pl.po index 961f967a9df1..eb81a0f1b444 100644 --- a/po/pl.po +++ b/po/pl.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-08-26\n" "PO-Revision-Date: 2023-08-25 14:19-0700\n" "Last-Translator: Kuba Jaroszewski \n" "Language-Team: Polish \n" diff --git a/po/pt-BR.po b/po/pt-BR.po index 06a8455f394e..5d611083cf70 100644 --- a/po/pt-BR.po +++ b/po/pt-BR.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-08-28\n" "PO-Revision-Date: 2023-08-25 09:32-0700\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/po/ru.po b/po/ru.po index 27e09d8a4196..2cdadc1a7ef1 100644 --- a/po/ru.po +++ b/po/ru.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-09-08\n" "PO-Revision-Date: 2023-08-25 14:28-0700\n" "Last-Translator: Yauheni Baltukha \n" "Language-Team: \n" diff --git a/po/tr.po b/po/tr.po index 989b5ef8d70b..94deb48e8cb4 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-08-26\n" "PO-Revision-Date: 2023-08-25 14:48-0700\n" "Last-Translator: akerem@protonmail.com\n" "Language-Team: Turkish \n" diff --git a/po/uk.po b/po/uk.po index 6479a70d2fa4..6da10ad69922 100644 --- a/po/uk.po +++ b/po/uk.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-09-19\n" "PO-Revision-Date: 2023-09-12 22:06+0000\n" "Last-Translator: Andrew Kushyk \n" "Language-Team: \n" diff --git a/po/zh-CN.po b/po/zh-CN.po index 3b74dde89142..284f8ded20a8 100644 --- a/po/zh-CN.po +++ b/po/zh-CN.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-09-18\n" "PO-Revision-Date: 2023-06-12 21:28-0700\n" "Last-Translator: Zhengping Jiang \n" "Language-Team: Language zh-Hans\n" diff --git a/po/zh-TW.po b/po/zh-TW.po index 0ee34f4d722f..6c23f11fa4d8 100644 --- a/po/zh-TW.po +++ b/po/zh-TW.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: \n" +"POT-Creation-Date: 2023-08-23\n" "PO-Revision-Date: 2023-06-02 14:43+0800\n" "Last-Translator: Hank Chen \n" "Language-Team: Traditional Chinese (Taiwan) \n"