mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-22 23:39:45 +00:00
This commit integrates the previously recovered ComfyUI Manager functionality with significant enhancements from PR #3367, including: ## Core Manager System Recovery - **v2 API Integration**: All manager endpoints now use `/v2/manager/queue/*` - **Task Queue System**: Complete client-side task queuing with WebSocket status - **Service Layer**: Comprehensive manager service with all CRUD operations - **Store Integration**: Full manager store with progress dialog support ## New Features & Enhancements - **Reactive Feature Flags**: Foundation for dynamic feature toggling - **Enhanced UI Components**: Improved loading states, progress tracking - **Package Management**: Install, update, enable/disable functionality - **Version Selection**: Support for latest/nightly package versions - **Progress Dialogs**: Real-time installation progress with logs - **Missing Node Detection**: Automated detection and installation prompts ## Technical Improvements - **TypeScript Definitions**: Complete type system for manager operations - **WebSocket Integration**: Real-time status updates via `cm-queue-status` - **Error Handling**: Comprehensive error handling with user feedback - **Testing**: Updated test suites for new functionality - **Documentation**: Complete backup documentation for recovery process ## API Endpoints Restored - `manager/queue/start` - Start task queue - `manager/queue/status` - Get queue status - `manager/queue/task` - Queue individual tasks - `manager/queue/install` - Install packages - `manager/queue/update` - Update packages - `manager/queue/disable` - Disable packages ## Breaking Changes - Manager API base URL changed to `/v2/` - Updated TypeScript interfaces for manager operations - New WebSocket message format for queue status This restores all critical manager functionality lost during the previous rebase while integrating the latest enhancements and maintaining compatibility with the current main branch. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
185 lines
6.7 KiB
Markdown
185 lines
6.7 KiB
Markdown
# Contributing Translations to ComfyUI
|
|
|
|
## Quick Start for New Languages
|
|
|
|
1. **Let us know** - Open an issue or reach out on Discord to request a new language
|
|
2. **Get technical setup help** - We'll help configure the initial files or you can follow the technical process below
|
|
3. **Automatic translation** - Our CI system will generate translations using OpenAI when you create a PR
|
|
4. **Review and refine** - You can improve the auto-generated translations and become a maintainer for that language
|
|
|
|
## Technical Process (Confirmed Working)
|
|
|
|
### Prerequisites
|
|
- Node.js installed
|
|
- Git/GitHub knowledge
|
|
- OpenAI API key (optional - CI will handle translations)
|
|
|
|
### Step 1: Update Configuration Files
|
|
|
|
**Time required: ~10 minutes**
|
|
|
|
#### 1.1 Update `.i18nrc.cjs`
|
|
Add your language code to the `outputLocales` array:
|
|
|
|
```javascript
|
|
module.exports = defineConfig({
|
|
// ... existing config
|
|
outputLocales: ['zh', 'zh-TW', 'ru', 'ja', 'ko', 'fr', 'es'], // Add your language here
|
|
reference: `Special names to keep untranslated: flux, photomaker, clip, vae, cfg, stable audio, stable cascade, stable zero, controlnet, lora, HiDream.
|
|
'latent' is the short form of 'latent space'.
|
|
'mask' is in the context of image processing.
|
|
Note: For Traditional Chinese (Taiwan), use Taiwan-specific terminology and traditional characters.
|
|
`
|
|
});
|
|
```
|
|
|
|
#### 1.2 Update `src/constants/coreSettings.ts`
|
|
Add your language to the dropdown options:
|
|
|
|
```typescript
|
|
{
|
|
id: 'Comfy.Locale',
|
|
name: 'Language',
|
|
type: 'combo',
|
|
options: [
|
|
{ value: 'en', text: 'English' },
|
|
{ value: 'zh', text: '中文' },
|
|
{ value: 'zh-TW', text: '繁體中文 (台灣)' }, // Add your language here
|
|
{ value: 'ru', text: 'Русский' },
|
|
{ value: 'ja', text: '日本語' },
|
|
{ value: 'ko', text: '한국어' },
|
|
{ value: 'fr', text: 'Français' },
|
|
{ value: 'es', text: 'Español' }
|
|
],
|
|
defaultValue: () => navigator.language.split('-')[0] || 'en'
|
|
},
|
|
```
|
|
|
|
#### 1.3 Update `src/i18n.ts`
|
|
Add imports for your new language files:
|
|
|
|
```typescript
|
|
// Add these imports (replace zh-TW with your language code)
|
|
import zhTWCommands from './locales/zh-TW/commands.json'
|
|
import zhTW from './locales/zh-TW/main.json'
|
|
import zhTWNodes from './locales/zh-TW/nodeDefs.json'
|
|
import zhTWSettings from './locales/zh-TW/settings.json'
|
|
|
|
// Add to the messages object
|
|
const messages = {
|
|
en: buildLocale(en, enNodes, enCommands, enSettings),
|
|
zh: buildLocale(zh, zhNodes, zhCommands, zhSettings),
|
|
'zh-TW': buildLocale(zhTW, zhTWNodes, zhTWCommands, zhTWSettings), // Add this line
|
|
// ... other languages
|
|
}
|
|
```
|
|
|
|
### Step 2: Generate Translation Files
|
|
|
|
#### Option A: Local Generation (Optional)
|
|
```bash
|
|
# Only if you have OpenAI API key configured
|
|
pnpm locale
|
|
```
|
|
|
|
#### Option B: Let CI Handle It (Recommended)
|
|
- Create your PR with the configuration changes above
|
|
- **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
|
|
|
|
```bash
|
|
pnpm typecheck # Check for TypeScript errors
|
|
pnpm dev # Start development server
|
|
```
|
|
|
|
**Testing checklist:**
|
|
- [ ] Language appears in ComfyUI Settings > Locale dropdown
|
|
- [ ] Can select the new language without errors
|
|
- [ ] Partial translations display correctly
|
|
- [ ] UI falls back to English for untranslated strings
|
|
- [ ] No console errors when switching languages
|
|
|
|
### Step 4: Submit PR
|
|
|
|
1. **Create PR** with your configuration changes
|
|
2. **CI will run** and automatically populate translation files
|
|
3. **Request review** from language maintainers: @Yorha4D @KarryCharon @DorotaLuna @shinshin86
|
|
4. **Get added to CODEOWNERS** as a reviewer for your language
|
|
|
|
## What Happens in CI
|
|
|
|
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
|
|
3. **Generates translations**: Uses OpenAI API to translate to all configured languages
|
|
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
|
|
|
|
Each language has 4 translation files:
|
|
- `main.json` - Main UI text (~2000+ entries)
|
|
- `commands.json` - Command descriptions (~200+ entries)
|
|
- `settings.json` - Settings panel (~400+ entries)
|
|
- `nodeDefs.json` - Node definitions (~varies based on installed nodes)
|
|
|
|
## Translation Quality
|
|
|
|
- **Auto-translations are high quality** but may need refinement
|
|
- **Technical terms** are preserved (flux, photomaker, clip, vae, etc.)
|
|
- **Context-aware** translations based on UI usage
|
|
- **Native speaker review** is encouraged for quality improvements
|
|
|
|
## Common Issues & Solutions
|
|
|
|
### Issue: TypeScript errors on imports
|
|
**Solution**: Ensure your language code matches exactly in all three files
|
|
|
|
### Issue: Empty translation files
|
|
**Solution**: This is normal - CI will populate them when you create a PR
|
|
|
|
### Issue: Language not appearing in dropdown
|
|
**Solution**: Check that the language code in `coreSettings.ts` matches your other files exactly
|
|
|
|
### Issue: Rate limits during local translation
|
|
**Solution**: This is expected - let CI handle the translation generation
|
|
|
|
## Regional Variants
|
|
|
|
For regional variants (like zh-TW for Taiwan), use:
|
|
- **Language-region codes**: `zh-TW`, `pt-BR`, `en-US`
|
|
- **Specific terminology**: Add region-specific context to the reference string
|
|
- **Native display names**: Use the local language name in the dropdown
|
|
|
|
## Getting Help
|
|
|
|
- **Tag translation maintainers**: @Yorha4D @KarryCharon @DorotaLuna @shinshin86
|
|
- **Check existing language PRs** for examples
|
|
- **Open an issue** describing your language addition request
|
|
- **Reference this tested process** - we've confirmed it works!
|
|
|
|
## Becoming a Language Maintainer
|
|
|
|
After your language is added:
|
|
1. **Get added to CODEOWNERS** for your language files
|
|
2. **Review future PRs** affecting your language
|
|
3. **Coordinate with other native speakers** for quality improvements
|
|
4. **Help maintain translations** as the UI evolves
|
|
|
|
---
|
|
|
|
*This process was tested and confirmed working with Traditional Chinese (Taiwan) addition.* |