This commit is contained in:
dingfeng.wong
2025-07-11 16:53:55 +08:00
parent 6bb1439323
commit b9dd14d562
+2 -1
View File
@@ -39,7 +39,8 @@ async def mutate_chinese_titles(data: Dict[str, Any]) -> None:
try: try:
# Translate Chinese text to English # Translate Chinese text to English
translation = await translator.translate(value, dest='en') translation = await translator.translate(value, dest='en')
data[key] = translation.text data[key] = translation.text + data[key]
console.print(f"[dim]Translated '{value}''{translation.text}'[/dim]") console.print(f"[dim]Translated '{value}''{translation.text}'[/dim]")
except Exception as e: except Exception as e:
console.print(f"[yellow]Warning: Failed to translate '{value}': {e}[/yellow]") console.print(f"[yellow]Warning: Failed to translate '{value}': {e}[/yellow]")