From a06b123e43f42d924ddb9524bec5bc44a128ecb7 Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Fri, 27 Oct 2023 01:25:34 +1100 Subject: [PATCH] added docs --- .github/workflows/translate.yml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index d8afb87..7fa2eef 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -1,6 +1,6 @@ name: Translate Readme -on: +on: # This workflow triggers on pushes and PRs to the main branch, specifically affecting the README.md push: branches: [ main ] paths: @@ -9,7 +9,7 @@ on: branches: [ main ] paths: - 'README.md' - workflow_dispatch: + workflow_dispatch: # Also provides a manual trigger option jobs: Translate: @@ -19,10 +19,10 @@ jobs: pull-requests: write steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout # Fetches the current repo's content + uses: actions/checkout@v3 - - name: Upload to Crowdin + - name: Upload to Crowdin # Uploads any changes in specified files to Crowdin uses: crowdin/github-action@v1 with: command: 'upload' @@ -32,7 +32,7 @@ jobs: CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - - name: Apply Machine Translation + - name: Apply Machine Translation # Applies machine translation to the new content in various languages uses: crowdin/github-action@v1 with: command: 'pre-translate' @@ -42,7 +42,7 @@ jobs: CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - - name: Download from Crowdin + - name: Download from Crowdin # Downloads the translated files from Crowdin uses: crowdin/github-action@v1 with: download_translations: true @@ -52,35 +52,32 @@ jobs: CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} - - name: Set Git Identity + - name: Set Git Identity # This sets the identity for the git user to clearly indicate that changes are made by the GitHub Action. run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - - name: Adjust .git permissions + - name: Adjust .git permissions # Adjusting permissions ensures that the GitHub Action has the required permissions to perform subsequent operations. run: sudo chmod -R 777 .git - - name: Switch to new branch + - name: Switch to new branch # It switches to a dedicated branch for Crowdin translations. This keeps translations separate until they're ready to be merged. run: | git checkout l10n_crowdin_translations - - name: Update paths for translated READMEs + - name: Update paths for translated READMEs # This step updates the paths in the translated READMEs, ensuring links and image sources point to the correct locations. run: | find readme -name "README-*.md" -exec sed -i 's|href="\./|href="../|g' {} \; find readme -name "README-*.md" -exec sed -i 's|src="\./|src="../|g' {} \; find readme -name "README-*.md" -exec sed -i "s|href='\./|href='../|g" {} \; find readme -name "README-*.md" -exec sed -i "s|src='\./|src='../|g" {} \; - - - - name: Commit changes + + - name: Commit changes # After updating paths, it commits and pushes the changes to the branch designated for translations. run: | git add -A git commit -m "Update paths in translated READMEs" git push origin l10n_crowdin_translations - - - - name: Create PR with new translations + - name: Create PR with new translations # The final step in the process is to create a Pull Request with the new translations. Once reviewed and approved, the translations can be merged into the main branch. uses: crowdin/github-action@v1 with: create_pull_request: true