[PR #30692] feat(i18n): Migrate translation workflow to Claude Code GitHub Actions #32923

Closed
opened 2026-02-21 20:52:20 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/30692

State: closed
Merged: Yes


Summary

Closes #30691

Replace the existing Bing Translate-based i18n workflow with Claude Code GitHub Actions for better translation quality and maintainability.

Changes

Deleted

  • web/scripts/auto-gen-i18n.js - Old Bing translate script
  • .github/workflows/translate-i18n-base-on-english.yml - Old workflow

Added

  • .github/workflows/translate-i18n-claude.yml - New Claude Code workflow

Modified

  • web/package.json - Removed i18n:gen script and bing-translate-api dependency
  • web/i18n-config/README.md - Updated documentation
  • web/pnpm-lock.yaml - Updated after removing dependency

Features

Three Change Scenarios Covered

Scenario Detection Processing
ADD Git diff + lines + i18n:check missing keys Translate and add new keys
UPDATE Git diff with both - and + lines Re-translate (old translation is stale)
DELETE Git diff - lines + i18n:check extra keys Remove via --auto-remove

Trigger Methods

  1. Automatic: Push to main branch with changes to web/i18n/en-US/*.json
  2. Manual: workflow_dispatch with configurable:
    • files: Specific files to translate
    • languages: Specific target languages
    • mode: incremental (default) or full

Three-Phase Approach

  1. VERIFY: Analyze git diff + run i18n:check
  2. SYNC: Process ADD/UPDATE/DELETE operations
  3. RE-VERIFY: Run lint:fix (for JSON key sorting) + i18n:check

Test Plan

  • Manual trigger workflow with full mode to verify all keys sync
  • Test with a small change to en-US to verify incremental mode
  • Verify lint:fix correctly sorts JSON keys
  • Verify i18n:check passes after sync

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/langgenius/dify/pull/30692 **State:** closed **Merged:** Yes --- ## Summary Closes #30691 Replace the existing Bing Translate-based i18n workflow with Claude Code GitHub Actions for better translation quality and maintainability. ## Changes ### Deleted - `web/scripts/auto-gen-i18n.js` - Old Bing translate script - `.github/workflows/translate-i18n-base-on-english.yml` - Old workflow ### Added - `.github/workflows/translate-i18n-claude.yml` - New Claude Code workflow ### Modified - `web/package.json` - Removed `i18n:gen` script and `bing-translate-api` dependency - `web/i18n-config/README.md` - Updated documentation - `web/pnpm-lock.yaml` - Updated after removing dependency ## Features ### Three Change Scenarios Covered | Scenario | Detection | Processing | |----------|-----------|------------| | **ADD** | Git diff `+` lines + i18n:check missing keys | Translate and add new keys | | **UPDATE** | Git diff with both `-` and `+` lines | Re-translate (old translation is stale) | | **DELETE** | Git diff `-` lines + i18n:check extra keys | Remove via --auto-remove | ### Trigger Methods 1. **Automatic**: Push to `main` branch with changes to `web/i18n/en-US/*.json` 2. **Manual**: `workflow_dispatch` with configurable: - `files`: Specific files to translate - `languages`: Specific target languages - `mode`: `incremental` (default) or `full` ### Three-Phase Approach 1. **VERIFY**: Analyze git diff + run i18n:check 2. **SYNC**: Process ADD/UPDATE/DELETE operations 3. **RE-VERIFY**: Run `lint:fix` (for JSON key sorting) + `i18n:check` ## Test Plan - [ ] Manual trigger workflow with `full` mode to verify all keys sync - [ ] Test with a small change to en-US to verify incremental mode - [ ] Verify lint:fix correctly sorts JSON keys - [ ] Verify i18n:check passes after sync 🤖 Generated with [Claude Code](https://claude.com/claude-code)
yindo added the pull-request label 2026-02-21 20:52:20 -05:00
yindo closed this issue 2026-02-21 20:52:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32923