Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/i18n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ name: Update Locales

on:
pull_request:
branches: [ main, master, dev* ]
branches: [ main, master ]
types: [opened, synchronize, reopened]
paths-ignore:
- '.github/**'
- '.husky/**'
- '.vscode/**'
- 'browser_tests/**'
- 'tests-ui/**'
workflow_dispatch:

jobs:
update-locales:
# Don't run on fork PRs
if: github.event.pull_request.head.repo.full_name == github.repository
# Only run on version-bump PRs from the main repo, or manual dispatch
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/[email protected]
Expand Down
23 changes: 18 additions & 5 deletions src/locales/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down