Skip to content

feat(i18n): Migrate translation workflow to Claude Code GitHub Actions#30692

Merged
crazywoola merged 23 commits intomainfrom
feat/i18n-claude-code-migration
Jan 7, 2026
Merged

feat(i18n): Migrate translation workflow to Claude Code GitHub Actions#30692
crazywoola merged 23 commits intomainfrom
feat/i18n-claude-code-migration

Conversation

@lyzno1
Copy link
Member

@lyzno1 lyzno1 commented Jan 7, 2026

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

- Replace Bing translate with Claude Code Action - Support three change scenarios: ADD, UPDATE, DELETE - Include lint:fix step for JSON key sorting - Update pnpm-lock.yaml after removing bing-translate-api Deleted: - web/scripts/auto-gen-i18n.js - .github/workflows/translate-i18n-base-on-english.yml Added: - .github/workflows/translate-i18n-claude.yml Modified: - web/package.json (removed i18n:gen, bing-translate-api) - web/i18n-config/README.md - web/pnpm-lock.yaml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 7, 2026 08:57
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. 🌊 feat:workflow Workflow related stuff. labels Jan 7, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lyzno1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request overhauls the project's internationalization (i18n) pipeline by replacing the legacy Bing Translate integration with a more advanced and maintainable solution utilizing Claude Code GitHub Actions. The change aims to enhance translation quality and streamline the localization process through intelligent detection of content changes, automated translation, and comprehensive verification steps, providing a more robust and efficient system for managing multilingual content.

Highlights

  • Migration to Claude Code: The internationalization (i18n) workflow has been migrated from Bing Translate to a new system powered by Claude Code GitHub Actions, aiming for better translation quality and maintainability.
  • Automated Translation Scenarios: The new workflow intelligently handles three key translation scenarios: adding new keys, updating existing keys (re-translation), and deleting removed keys, ensuring all changes to source language files are propagated.
  • Flexible Triggering: Translations can be triggered automatically upon pushes to the main branch affecting en-US i18n files, or manually via workflow_dispatch with configurable file, language, and mode options (incremental or full).
  • Three-Phase Process: The translation process follows a robust three-phase approach: initial verification (git diff + i18n:check), synchronization (processing ADD/UPDATE/DELETE), and re-verification (lint:fix + i18n:check).
  • Dependency Removal: The bing-translate-api dependency and its associated script (web/scripts/auto-gen-i18n.js) have been removed, simplifying the project's dependencies and build process.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/translate-i18n-base-on-english.yml
    • .github/workflows/translate-i18n-claude.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the Bing Translate-based i18n automation with Claude Code GitHub Actions for improved translation quality and workflow flexibility.

Key Changes

  • Removed the legacy Bing Translate script and npm dependency
  • Introduced a new Claude Code workflow with incremental and full sync modes
  • Enhanced change detection to distinguish between ADD, UPDATE, and DELETE operations

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
web/scripts/auto-gen-i18n.js Deleted legacy Bing Translate translation script
web/package.json Removed i18n:gen script and bing-translate-api dependency
web/i18n-config/README.md Updated documentation to reflect Claude Code workflow
.github/workflows/translate-i18n-claude.yml New Claude Code workflow with three-phase sync approach
.github/workflows/translate-i18n-base-on-english.yml Deleted old Bing Translate workflow
Files not reviewed (1)
  • web/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully migrates the internationalization workflow from a custom Bing Translate script to a more maintainable Claude Code GitHub Action. The changes are well-contained, removing old scripts, dependencies, and updating documentation. The deletion of the old auto-gen-i18n.js script and its associated i18n:gen command and bing-translate-api dependency is clean. I have one suggestion for improving the documentation to ensure it fully aligns with the new workflow's capabilities as described in the PR summary.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
hyoban
hyoban previously approved these changes Jan 7, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 7, 2026
hyoban
hyoban previously approved these changes Jan 7, 2026
- Add PHASE 4: COMMIT AND CREATE PR instructions - Configure git user for commits - Add timeout_minutes parameter 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
hyoban
hyoban previously approved these changes Jan 7, 2026
Allow Claude to use git and gh commands for PR creation: - Bash(git:*) - git operations - Bash(gh:*) - GitHub CLI for PR creation - Bash(pnpm:*) - package manager commands - Read,Write,Edit,Glob,Grep - file operations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
hyoban
hyoban previously approved these changes Jan 7, 2026
Replace custom GH_TOKEN env with official github_token input: - github_token is the official parameter per action.yml - Action automatically sets GITHUB_TOKEN and GH_TOKEN internally - Remove unnecessary use_oauth parameter 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
hyoban
hyoban previously approved these changes Jan 7, 2026
@lyzno1 lyzno1 marked this pull request as draft January 7, 2026 09:22
pnpm is not pre-installed on GitHub ubuntu runners. Add pnpm/action-setup and setup-node before Claude Code action. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
lyzno1 and others added 14 commits January 7, 2026 17:25
Remove --model claude-sonnet-4-5-20250929 as it's not a valid model identifier. Let Claude Code Action use its default model instead. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Temporary change to test workflow in PR CI. Will be reverted after testing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update actions/checkout to v6 - Update actions/setup-node to v6 - Add test key to en-US/app.json to trigger workflow - Will be reverted after testing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Revert "test(i18n): add pull_request trigger for CI testing" This reverts commits 7130bbe and 7051d96. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update actions/checkout from v4 to v6 - Update actions/setup-node from v4 to v6 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add PR event handling with correct base/head SHA references - Handle edge case when github.event.before is null/zero SHA - Replace `cd web && pnpm` with `pnpm --dir web` for allowedTools compatibility - Remove unnecessary Bash(cd:*) from allowedTools 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unsupported timeout_minutes parameter - Add tool restrictions: use Read/Edit instead of cat/bash scripts - Add efficiency rules: batch edits per language file - Instruct Claude to insert keys at beginning, let lint:fix sort - Split combined git commands to run one by one - Update allowedTools syntax for better matching - Increase max-turns to 150 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove pull_request trigger (was for testing) - Remove PR event handling code - Remove _test_ci_trigger test key from en-US/app.json 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add important rule: if zh-Hans or ja-JP files were also modified in the same push, skip UPDATE operations for those languages to preserve manual translations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Instead of blindly skipping, apply smarter rules for manually modified files: - Missing keys: still ADD them (completeness required) - Existing translations: only update if completely wrong/unrelated - Keep manual translations if roughly correct (respect human work) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@lyzno1 lyzno1 marked this pull request as ready for review January 7, 2026 11:02
@lyzno1 lyzno1 removed the lgtm This PR has been approved by a maintainer label Jan 7, 2026
@lyzno1
Copy link
Member Author

lyzno1 commented Jan 7, 2026

When reviewing PRs that modify en-US i18n values (UPDATE scenarios), reviewers must ensure that translation sync CI has run successfully or that corresponding translations are updated in the same PR.
ADD/DELETE cases are safely handled by automated i18n checks.
cc @crazywoola

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 7, 2026
@crazywoola crazywoola merged commit a422908 into main Jan 7, 2026
16 checks passed
@crazywoola crazywoola deleted the feat/i18n-claude-code-migration branch January 7, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌊 feat:workflow Workflow related stuff. lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

4 participants