Skip to content

Conversation

@modernchina123
Copy link
Collaborator

📋 Overview

This PR introduces an automated translation workflow system, adds Korean language support, and comprehensively improves the translation quality and localization experience for Chinese and Korean changelogs.

✨ Key Features

1. Auto-Translation System

  • New GitHub Actions Workflow (.github/workflows/auto-translate.yml)
    • Automatically triggers translation when pushing to non-main branches
    • Creates translation branches and commits translated results
  • New Translation Script (translate.js)
    • Uses OpenAI API for intelligent translation
    • Supports Chinese and Korean translation
    • Includes retry mechanism and chunking for large files

2. Translation Quality Improvements

  • Proper Noun Recognition
    • Automatically identifies capitalized proper nouns (product names, module names, etc.)
    • Fixed terminology rules: Frontier, Crypto Frontier, Robotics Frontier, Model Comparison, etc. remain in English
    • Specific term translations: Lineage血缘, How运作方式, Timeline活动时间, Access参与方式, Lock锁仓
  • Natural Language Expression
    • Avoids literal translation, uses context-appropriate expressions
    • Example: action translated as 操作 or 动作 based on context, not literally as 行动
  • Unified Date Format
    • Chinese: 2025 年 12 月 04 日 (spaces between characters and numbers, zero-padded month/day)
    • Korean: 2025년 12월 04일 (zero-padded month/day)

3. Multi-language Changelog Support

  • New Korean Changelog (ko/changelog/2025.mdx)
    • Complete Korean translation of 2025 changelog
    • All UI elements localized
  • Updated Chinese Changelog (cn/changelog/2025.mdx)
    • Improved translation quality
    • Unified date formats
    • Fixed proper noun translations
  • Updated English Changelog (en/changelog/2025.mdx)
    • Added React hooks import for interactive features

4. UI Element Localization

  • Front Matter
    • Chinese: title: "变更日志", description: "本文档记录了 Codatta 在 2025 年的所有更新、修复和新功能。"
    • Korean: title: "변경 로그", description: "이 변경 로그는 2025년 Codatta의 모든 업데이트, 수정 및 새로운 기능을 문서화합니다."
  • Result Text
    • Chinese: 条结果
    • Korean: 개 결과
  • Filter Labels
    • Chinese: 全部, 核心功能发布, 调整与优化, 修复与功能下线, 活动启动
    • Korean: 전체, 핵심 기능 출시, 조정 및 최적화, 수정 및 기능 종료, 캠페인 시작
  • Month Labels
    • Chinese: 全部月份, 十二月, 十一月, 十月, etc.
    • Korean: 전체, 12월, 11월, 10월, etc.

5. Code Standardization

  • Code Comments and Logs
    • All code comments translated to English
    • All log messages and error messages translated to English
    • Translation prompts (systemPrompt) remain in Chinese/Korean as they are AI instructions

6. Configuration Updates

  • Updated docs.json
    • Added Korean changelog navigation configuration

🐛 Bug Fixes

  1. Parsing Error Fixes

    • Fixed code block marker errors in Korean changelog ( ```html and extra ` ```)
    • Fixed JSX parsing errors
  2. Translation Consistency

    • Unified proper noun handling rules
    • Unified date formats
    • Unified terminology translations
  3. UI Element Translation

    • Fixed untranslated filter labels
    • Fixed untranslated result text
    • Fixed untranslated front matter

📁 File Changes

  • New Files:

    • .github/workflows/auto-translate.yml - Auto-translation workflow
    • translate.js - Translation script
    • ko/changelog/2025.mdx - Korean changelog
    • PR_DESCRIPTION.md - PR description document
  • Modified Files:

    • cn/changelog/2025.mdx - Chinese changelog updates
    • en/changelog/2025.mdx - English changelog updates
    • docs.json - Navigation configuration updates

🔄 Workflow

  1. Developer pushes code to a non-main branch
  2. GitHub Actions automatically triggers translation workflow
  3. Workflow runs translate.js script
  4. Script reads English changelog and translates to Chinese and Korean using OpenAI API
  5. Automatically creates translation branch (format: {source-branch}-auto-translate-{timestamp})
  6. Commits translated results to new branch

📝 Notes

  • Translation script requires OPENAI_API_KEY environment variable
  • Workflow automatically skips branches containing auto-translate to avoid circular triggers
  • Translation prompts are optimized to ensure consistency of proper nouns and terminology
  • Code comments and logs are in English, while translation prompts remain in target languages

✅ Testing

  • Chinese changelog displays correctly
  • Korean changelog displays correctly, no parsing errors
  • All UI elements properly localized
  • Date formats unified
  • Proper nouns handled correctly
  • Auto-translation workflow runs successfully

📊 Statistics

  • 7 files changed
  • 1,456 insertions, 181 deletions
  • Net: +1,275 lines

modernchina123 and others added 9 commits January 4, 2026 19:00
…hangelog

- Enhanced translation prompts with automatic proper noun recognition
- Fixed proper nouns: Model Comparison, Spot LLM's Mistakes, Correct LLM's Mistakes, Food Science, Lifelog Canvas, Crypto Frontier, Robotics Frontier
- Keep proper nouns in English when used as product/module names
- Translate descriptive terms (e.g., 'model comparison' in lowercase) to Chinese
- Updated both Chinese and Korean translation prompts
…and Korean changelogs

- Fixed Chinese front matter: title and description now in Chinese
- Fixed Korean front matter: title and description now in Korean
- Fixed result text: '条结果' for Chinese, '개 결과' for Korean
- Fixed filter labels: translated all filter types and month names
- Removed erroneous code block markers in Korean changelog that caused parsing errors
…e block errors

- Fixed Chinese front matter: title to '变更日志', description in Chinese
- Fixed Korean front matter: title to '변경 로그', description in Korean
- Fixed result text: '条结果' for Chinese, '개 결과' for Korean
- Fixed filter labels: translated all filter types and month names for both languages
- Removed erroneous code block markers in Korean changelog () that caused parsing errors
- Convert all Chinese comments in translate.js to English
- Convert all Chinese log messages and error messages to English
- Convert all Chinese comments in GitHub Actions workflow to English
- Keep systemPrompt in Chinese/Korean as they are translation instructions for AI
- Add PR description document
@beingzy
Copy link
Collaborator

beingzy commented Jan 4, 2026

beyond my expectations, LGTM

@beingzy beingzy merged commit 9f8d863 into main Jan 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants