feat(tools): add batch translation support with parallel processing#1099
Merged
lacolaco merged 1 commit intoangular:mainfrom Nov 21, 2025
Merged
feat(tools): add batch translation support with parallel processing#1099lacolaco merged 1 commit intoangular:mainfrom
lacolaco merged 1 commit intoangular:mainfrom
Conversation
Enhance the translation tool to support directory-based batch translation with configurable concurrency control. Changes: - Add glob pattern support for file matching - Add -c/--concurrency option to control parallel processing (default: 2) - Add --force option to re-translate already translated files - Implement p-limit for parallel execution control - Improve error handling with temp file logging - Skip translated files by default (.en.md existence check) - Display comprehensive summary with success/failure counts Usage examples: pnpm run translate -w "adev-ja/src/content/guide/*.md" pnpm run translate -w -c 5 "adev-ja/src/content/**/*.md" pnpm run translate -w --force "adev-ja/src/content/guide/*.md"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
翻訳ツール (
pnpm run translate) にディレクトリ対応と並列翻訳機能を追加しました。変更内容
機能追加
Glob パターン対応
.en.md/.en.ts/.en.jsonファイルを自動除外並列処理制御
-c/--concurrencyオプションで並列数を指定(デフォルト: 2)p-limitパッケージを使用して並列実行を制御翻訳済みファイル管理
.en.mdが存在するファイルをスキップ--forceオプションで翻訳済みファイルも再処理エラーハンドリング改善
使用例
技術的詳細
p-limit@7.2.0を新規追加/tmp/translate-errors-{timestamp}.logに詳細を保存.en.mdファイルの存在確認で判定動作確認
-c/--concurrency): ✅--forceオプション: ✅