diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml new file mode 100644 index 000000000..8d31e6a46 --- /dev/null +++ b/.github/workflows/translate.yml @@ -0,0 +1,33 @@ +name: Translate README + +on: + push: + branches: + - main + paths: + - 'README.md' + +jobs: + translate: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Translate README.md to Spanish + run: | + TEXT=$(cat README.md) + TRANSLATED_TEXT=$(curl -X POST "https://libretranslate.com/translate" \ + -H "Content-Type: application/json" \ + -d "{\"q\": \"$TEXT\", \"source\": \"en\", \"target\": \"es\"}" \ + | jq .translatedText) + echo "$TRANSLATED_TEXT" > README.es.md + + - name: Commit and push translated README + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add README.es.md + git commit -m "Add translated README.es.md" + git push diff --git a/.gitignore b/.gitignore index f851dbab6..4aa0878ee 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ .venv/ env/ venv/ +ChatDev_conda_env/ +WareHouse/ \ No newline at end of file