diff --git a/.github/workflows/i18n.yaml b/.github/workflows/i18n.yaml index c823770adb..dbe34e8788 100644 --- a/.github/workflows/i18n.yaml +++ b/.github/workflows/i18n.yaml @@ -1,19 +1,17 @@ name: Update Locales 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, master, dev* ] - paths-ignore: - - '.github/**' - - '.husky/**' - - '.vscode/**' - - 'browser_tests/**' - - 'tests-ui/**' + branches: [ main ] + types: [opened, synchronize, reopened] jobs: update-locales: - # Don't run on fork PRs - if: github.event.pull_request.head.repo.full_name == github.repository + # 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: - uses: Comfy-Org/ComfyUI_frontend_setup_action@v2.3 diff --git a/src/locales/CONTRIBUTING.md b/src/locales/CONTRIBUTING.md index 76fe98fe19..68beacb382 100644 --- a/src/locales/CONTRIBUTING.md +++ b/src/locales/CONTRIBUTING.md @@ -84,8 +84,9 @@ npm run locale #### Option B: Let CI Handle It (Recommended) - Create your PR with the configuration changes above -- Our GitHub CI will automatically generate translation files -- Empty JSON files are fine - they'll be populated by the workflow +- **Important**: Translation files will be generated during release PRs, not feature PRs +- Empty JSON files are fine - they'll be populated during the next release workflow +- For urgent translation needs, maintainers can manually trigger the workflow ### Step 3: Test Your Changes @@ -110,11 +111,23 @@ npm run dev # Start development server ## What Happens in CI -Our automated translation workflow: +Our automated translation workflow now runs on release PRs (version-bump-* branches) to improve development performance: + +### For Feature PRs (Regular Development) +- **No automatic translations** - faster reviews and fewer conflicts +- **English-only development** - new strings show in English until release +- **Focus on functionality** - reviewers see only your actual changes + +### For Release PRs (version-bump-* branches) 1. **Collects strings**: Scans the UI for translatable text -2. **Updates English files**: Ensures all strings are captured +2. **Updates English files**: Ensures all strings are captured 3. **Generates translations**: Uses OpenAI API to translate to all configured languages -4. **Commits back**: Automatically updates your PR with complete translations +4. **Commits back**: Automatically updates the release PR with complete translations + +### Manual Translation Updates +If urgent translation updates are needed outside of releases, maintainers can: +- Trigger the "Update Locales" workflow manually from GitHub Actions +- The workflow supports manual dispatch for emergency translation updates ## File Structure