From 9796bf42ceccffe9719241adf0cc62865f6d9230 Mon Sep 17 00:00:00 2001 From: Keunes <11229646+keunes@users.noreply.github.com> Date: Thu, 3 Feb 2022 22:57:23 +0100 Subject: [PATCH 1/4] Update translation-updates-to-main-repo.yml --- .../translation-updates-to-main-repo.yml | 55 +++++++++---------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/.github/workflows/translation-updates-to-main-repo.yml b/.github/workflows/translation-updates-to-main-repo.yml index e4b9eab98..08f3c1764 100644 --- a/.github/workflows/translation-updates-to-main-repo.yml +++ b/.github/workflows/translation-updates-to-main-repo.yml @@ -23,20 +23,17 @@ jobs: name: Generate & push translated files runs-on: ubuntu-latest steps: - # Check out the repository and download it to the runner, allowing to run actions against the code - - name: Get main repository + - name: Install mdpo + run: pip install mdpo + - name: Get main branch uses: actions/checkout@v2 with: ref: master - - name: Get translation repository + - name: Get translation files branch uses: actions/checkout@v2 with: ref: translation-files path: translation-files - - run: git branch - - run: ls -al - - name: Install mdpo - run: pip install mdpo - name: Set languages id: lang-set run: | @@ -55,28 +52,20 @@ jobs: languagelist=${languagelist//'en'} # Make variable consistent between steps echo "languages=$languagelist" >> $GITHUB_ENV - - name: Print tree - run: | - sudo apt-get install tree - tree -L 2 - - name: Print languages - run: | - languages=(${{ env.languages }}) - for language in "${languages[@]}" - do echo $language - done - name: Make Contribution pages run: | cd _i18n/en/contribute languages=(${{ env.languages }}) for language in "${languages[@]}" - do mkdir -p ../../$language/contribute + do + mkdir -p ../../$language/contribute done for file in * do for language in "${languages[@]}" - do po2md $file --po-files ../../../translation-files/contribute-pages/site-contribute_$language.po --save ../../$language/contribute/$file - git add ../../$language/contribute/$file + do + po2md $file --po-files ../../../translation-files/contribute-pages/site-contribute_$language.po --save ../../$language/contribute/$file + git add ../../$language/contribute/$file done done - name: Make Documentation pages @@ -85,13 +74,15 @@ jobs: cd _i18n/en/documentation languages=(${{ env.languages }}) for language in "${languages[@]}" - do mkdir -p ../../$language/documentation + do + mkdir -p ../../$language/documentation done for file in *.md do for language in "${languages[@]}" - do po2md $file --po-files ../../../translation-files/documentation-pages/site-documentation_$language.po --save ../../$language/documentation/$file - git add ../../$language/documentation/$file + do + po2md $file --po-files ../../../translation-files/documentation-pages/site-documentation_$language.po --save ../../$language/documentation/$file + git add ../../$language/documentation/$file done done # sub-level files @@ -101,14 +92,15 @@ jobs: cd $category languages=(${{ env.languages }}) for language in "${languages[@]}" - do mkdir -p ../../../$language/documentation/$category + do + mkdir -p ../../../$language/documentation/$category done for file in * do for language in "${languages[@]}" do po2md $file --po-files ../../../../translation-files/documentation-pages/site-documentation_$language.po --save ../../../$language/documentation/$category/$file - git add ../../../$language/documentation/$category/$file + git add ../../../$language/documentation/$category/$file done done cd ../ @@ -119,21 +111,24 @@ jobs: ls languages=(${{ env.languages }}) for language in "${languages[@]}" - do mkdir -p ../../$language/general + do + mkdir -p ../../$language/general done for file in * do for language in "${languages[@]}" - do po2md $file --po-files ../../../translation-files/general-pages/site-general_$language.po --save ../../$language/general/$file - git add ../../$language/general/$file + do + po2md $file --po-files ../../../translation-files/general-pages/site-general_$language.po --save ../../$language/general/$file + git add ../../$language/general/$file done done - name: Stage yml files run: | languages=(${{ env.languages }}) for language in "${languages[@]}" - do cp translation-files/general-strings/$language.yml _i18n/$language.yml - git add _i18n/$language.yml + do + cp translation-files/general-strings/$language.yml _i18n/$language.yml + git add _i18n/$language.yml done - name: Commit changes run: | From 934443afcf8f87f418ab5693c2ec68ce6a3f5fc0 Mon Sep 17 00:00:00 2001 From: Keunes <11229646+keunes@users.noreply.github.com> Date: Thu, 3 Feb 2022 23:03:27 +0100 Subject: [PATCH 2/4] Move General pages to the beginning --- .../translation-updates-to-main-repo.yml | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/translation-updates-to-main-repo.yml b/.github/workflows/translation-updates-to-main-repo.yml index 08f3c1764..eef27c998 100644 --- a/.github/workflows/translation-updates-to-main-repo.yml +++ b/.github/workflows/translation-updates-to-main-repo.yml @@ -52,6 +52,22 @@ jobs: languagelist=${languagelist//'en'} # Make variable consistent between steps echo "languages=$languagelist" >> $GITHUB_ENV + - name: Make General pages + run: | + cd _i18n/en/general + languages=(${{ env.languages }}) + for language in "${languages[@]}" + do + mkdir -p ../../$language/general + done + for file in * + do + for language in "${languages[@]}" + do + po2md $file --po-files ../../../translation-files/general-pages/site-general_$language.po --save ../../$language/general/$file + git add ../../$language/general/$file + done + done - name: Make Contribution pages run: | cd _i18n/en/contribute @@ -105,23 +121,6 @@ jobs: done cd ../ done - - name: Make General pages - run: | - cd _i18n/en/general - ls - languages=(${{ env.languages }}) - for language in "${languages[@]}" - do - mkdir -p ../../$language/general - done - for file in * - do - for language in "${languages[@]}" - do - po2md $file --po-files ../../../translation-files/general-pages/site-general_$language.po --save ../../$language/general/$file - git add ../../$language/general/$file - done - done - name: Stage yml files run: | languages=(${{ env.languages }}) From e9ac6fcedc75165c446a41dc5276654a6b74d5e3 Mon Sep 17 00:00:00 2001 From: Keunes <11229646+keunes@users.noreply.github.com> Date: Thu, 3 Feb 2022 23:09:04 +0100 Subject: [PATCH 3/4] Remove debugging left-over --- .github/workflows/translation-updates-to-main-repo.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/translation-updates-to-main-repo.yml b/.github/workflows/translation-updates-to-main-repo.yml index eef27c998..a5a76f798 100644 --- a/.github/workflows/translation-updates-to-main-repo.yml +++ b/.github/workflows/translation-updates-to-main-repo.yml @@ -43,7 +43,6 @@ jobs: languagelist=$(cat _config.yml | grep "languages: \[.*\]" ) languagelist=${languagelist//[} languagelist=${languagelist//]} - echo $languagelist languagelist=${languagelist//'languages: '} fi languagelist=${languagelist//,} From afc998911e91934545af358a28ef2ee8b60189f5 Mon Sep 17 00:00:00 2001 From: Keunes <11229646+keunes@users.noreply.github.com> Date: Wed, 9 Feb 2022 22:28:19 +0100 Subject: [PATCH 4/4] Add Bugs & First Aid documentation sub-section --- .github/workflows/translation-updates-to-main-repo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translation-updates-to-main-repo.yml b/.github/workflows/translation-updates-to-main-repo.yml index a5a76f798..1f27e3d26 100644 --- a/.github/workflows/translation-updates-to-main-repo.yml +++ b/.github/workflows/translation-updates-to-main-repo.yml @@ -101,7 +101,7 @@ jobs: done done # sub-level files - documentation_groups=(automation general getting-started playback podcasters-hosters queue subscriptions) + documentation_groups=(automation general getting-started playback podcasters-hosters queue subscriptions bugs-first-aid) for category in "${documentation_groups[@]}" do cd $category