Skip to content

Commit

Permalink
Add workshop translation repo as submodule
Browse files Browse the repository at this point in the history
Add auto-translation pipeline
  • Loading branch information
Bruce-Moe committed Sep 18, 2024
1 parent 72454c0 commit a500861
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/auto-translation.yaml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "translation-tool"]
path = translation-tool
url = https://github.com/NuevoFoundation/WorkshopsAutoTranslation
branch = main
2 changes: 1 addition & 1 deletion content/english/csharp-basics/comments.md
Original file line number Diff line number Diff line change
@@ -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
---
Expand Down
1 change: 1 addition & 0 deletions translation-tool
Submodule translation-tool added at 46d196

0 comments on commit a500861

Please sign in to comment.