mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 01:09:46 +00:00
Add debug step to check: - If subscription section exists in source (en) locale - If subscription section exists in target (zh) locale - Git working tree status before commit This will help diagnose why lobe-i18n isn't generating changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
66 lines
2.5 KiB
YAML
66 lines
2.5 KiB
YAML
name: "i18n: Update Core"
|
|
description: "Generates and updates translations for core ComfyUI components using OpenAI"
|
|
|
|
on:
|
|
# Manual dispatch for urgent translation updates
|
|
workflow_dispatch:
|
|
# Only trigger on PRs to main/master - additional branch filtering in job condition
|
|
pull_request:
|
|
branches: [ main ]
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
update-locales:
|
|
# Branch detection: Only run for manual dispatch or version-bump-* branches from main repo
|
|
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-'))
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
|
|
# Setup playwright environment
|
|
- name: Setup ComfyUI Frontend
|
|
uses: ./.github/actions/setup-frontend
|
|
with:
|
|
include_build_step: true
|
|
- name: Setup ComfyUI Server
|
|
uses: ./.github/actions/setup-comfyui-server
|
|
with:
|
|
launch_server: true
|
|
- name: Setup Playwright
|
|
uses: ./.github/actions/setup-playwright
|
|
|
|
- name: Start dev server
|
|
# Run electron dev server as it is a superset of the web dev server
|
|
# We do want electron specific UIs to be translated.
|
|
run: pnpm dev:electron &
|
|
|
|
# Update locales, collect new strings and update translations using OpenAI, then commit changes
|
|
- name: Update en.json
|
|
run: pnpm collect-i18n
|
|
env:
|
|
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
|
- name: Update translations
|
|
run: pnpm locale
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
- name: Debug locale state
|
|
run: |
|
|
echo "=== Checking if subscription exists in source (en) ==="
|
|
jq '.subscription | keys' src/locales/en/main.json || echo "No subscription section in en"
|
|
echo "=== Checking if subscription exists in target (zh) ==="
|
|
jq '.subscription | keys' src/locales/zh/main.json || echo "No subscription section in zh"
|
|
echo "=== Git working tree status ==="
|
|
git status --porcelain src/locales/
|
|
- name: Commit updated locales
|
|
run: |
|
|
git config --global user.name 'github-actions'
|
|
git config --global user.email 'github-actions@github.com'
|
|
git add src/locales/
|
|
if ! git diff --staged --quiet; then
|
|
git commit -m "Update locales"
|
|
git push origin HEAD:${{ github.head_ref }}
|
|
else
|
|
echo "No locale changes to commit"
|
|
fi
|