Skip to content

Translate

Translate #2

Workflow file for this run

name: Translate
on:
workflow_dispatch:
inputs:
file:
description: "File to translate"
required: true
jobs:
translate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12-dev"
- name: Install dependencies
run: pip install -r requirements.txt && sudo apt update && sudo apt install gettext -y
- name: Run translate.py
run: python scripts/translate.py ${{ github.event.inputs.file }} -t google -s
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "python-docs-turkish"
git add ${{ github.event.inputs.file }}
git commit -m "Translate ${{ github.event.inputs.file }}"
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
token: ${{ secrets.BOT_PAT }}
commit-message: Translate ${{ github.event.inputs.file }}
author: python-docs-turkish <[email protected]>
committer: python-docs-turkish <[email protected]>
branch: translate-${{ github.event.inputs.file }}
delete-branch: true
title: Translate Translate ${{ github.event.inputs.file }}
body: "Translated: ${{ github.event.inputs.file }}"
labels: new-translation