Skip to content

Commit b49a2d9

Browse files
authored
fix(tools): improve translator summary output formatting (#1109)
- Replace consola.box() with standard log methods to avoid layout issues with mixed-width characters - Show success/warning status based on translation results - Display failed files as plain text for easy copy-paste
1 parent 673ee48 commit b49a2d9

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

tools/translator/main.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,23 @@ async function main() {
305305
await writeFile(errorLogPath, errorDetails, 'utf-8');
306306
}
307307

308-
consola.box(`
309-
翻訳完了
310-
311-
成功: ${succeeded.length}
312-
失敗: ${failed.length}
313-
${failed.length > 0 ? '\n失敗したファイル:\n' + failed.map((r) => ` - ${r.file}`).join('\n') : ''}
314-
${errorLogPath ? `\nエラー詳細: ${errorLogPath}` : ''}
315-
`);
308+
if (failed.length === 0) {
309+
consola.success('翻訳完了');
310+
} else {
311+
consola.warn('翻訳完了(一部失敗)');
312+
}
313+
314+
consola.info(`成功: ${succeeded.length}件`);
315+
consola.info(`失敗: ${failed.length}件`);
316+
317+
if (failed.length > 0) {
318+
console.log('\n失敗したファイル:');
319+
failed.forEach((r) => console.log(r.file));
320+
}
321+
322+
if (errorLogPath) {
323+
consola.info(`エラー詳細: ${errorLogPath}`);
324+
}
316325

317326
if (failed.length > 0) {
318327
process.exit(1);

0 commit comments

Comments
 (0)