Skip to content

Update translations for all languages [2026-05-27] #15

Update translations for all languages [2026-05-27]

Update translations for all languages [2026-05-27] #15

name: Translate README
on:
push:
paths:
- 'README.md'
- 'i18n/tools/translate_readme.py'
- 'i18n/tools/translation_terms.py'
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
translate-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
persist-credentials: true
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: '3.x'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gettext
pip install --upgrade pip
pip install deep-translator markdown beautifulsoup4
- name: Cache Python dependencies
uses: actions/cache@main
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/translate_readme.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Restore translation cache
uses: actions/cache@main
with:
path: translation_cache_readme.json
key: ${{ runner.os }}-readme-translations-${{ hashFiles('README.md') }}
restore-keys: |
${{ runner.os }}-readme-translations-
- name: Translate README
run: python3 i18n/tools/translate_readme.py README.md i18n/languages/
- name: Pull changes
run: |
git pull origin main
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add i18n/languages/
if git diff --cached --quiet; then
echo "No changes to commit."
else
git commit -m "Update translations for README [$(date +%Y-%m-%d)]"
git push
fi