diff --git a/.github/workflows/auto-translation.yaml b/.github/workflows/auto-translation.yaml new file mode 100644 index 000000000..2c33ed9d8 --- /dev/null +++ b/.github/workflows/auto-translation.yaml @@ -0,0 +1,44 @@ +name: Auto Translation + +on: + pull_request: + paths: + - content/english/** + +jobs: + auto-translate: + runs-on: ubuntu-latest + + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 2 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '8.0.x' # or the version your project requires + + - name: Run Translation Tool + env: + GITHUB_TOKEN: ${{ secrets.MODELS_TOKEN }} + run: | + languages=("french" "spanish" "portuguese" "german" "kyrgyz" "simplified-chinese" "traditional-chinese") + changed_files=$(git diff --name-only -r HEAD^1 HEAD | grep '^content/english/.*/[^/]*\.md$') + for file in $changed_files; do + echo "Translating $file" + for lang in "${languages[@]}"; do + dotnet run --project translation-tool/WorkshopAutoTranslation/WorkShopTranslationV2 -- "$file" "$lang" + done + done + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "[Github Actions] Add AI translations" diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..51c2a29ca --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "translation-tool"] + path = translation-tool + url = https://github.com/NuevoFoundation/WorkshopsAutoTranslation + branch = main diff --git a/content/english/csharp-basics/comments.md b/content/english/csharp-basics/comments.md index 7d27582fa..a3ebca2ab 100644 --- a/content/english/csharp-basics/comments.md +++ b/content/english/csharp-basics/comments.md @@ -1,6 +1,6 @@ --- title: "Comments" -description: "Introduce comments in C#." +description: "Introduce comments in C#. TESTING" date: 2024-09-16T00:00:00Z weight: 3 --- diff --git a/translation-tool b/translation-tool new file mode 160000 index 000000000..46d196894 --- /dev/null +++ b/translation-tool @@ -0,0 +1 @@ +Subproject commit 46d1968948c8ae20bc4ae3243b6b08c8e30192aa