wildcard/caro

feat(i18n): Add GitHub Action for automated translations (WP07)

オープン

#465 opened on 2026/01/15

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (6 件のフォーク)auto 404
enhancementgood first issuei18n

Repository metrics

Stars
 (35 個のスター)
PR merge metrics
 (PR metrics pending)

説明

Context

Part of the i18n feature implementation (branch: 004-add-internationalization-i18n).

Parent Work: Core i18n infrastructure complete in PR #383 + follow-up commits Priority: P2 (Nice to have for v1.2.0) Work Package: WP07

Goal

Automated translation workflow that triggers on English content changes and creates PRs with GPT-4 translations for all 14 non-English locales.

Acceptance Criteria

  • Update locales/en/navigation.json, push to main
  • GitHub Action runs successfully
  • Creates PR with translations within 1 hour
  • PR includes translations for all 14 locales with preserved placeholders

Subtasks

  • T028: Create .github/workflows/translate.yml workflow file
  • T029: Create .github/scripts/translate.js Node.js translation script
  • T030: Configure OpenAI API integration (official Node.js SDK)
  • T031: Add matrix strategy for 14 locales with max-parallel: 3
  • T032: Add translation cache using actions/cache@v5
  • T033: Add PR creation using peter-evans/create-pull-request@v6
  • T034: Test workflow with sample English content change

Implementation Notes

  1. Use official OpenAI Node.js SDK
  2. Translation script should:
    • Read changed English JSON files from git diff
    • For each file/locale: call GPT-4 with context-aware prompt
    • Preserve placeholders, brand names, technical terms
    • Handle rate limiting with retries and exponential backoff
  3. Contract available at: kitty-specs/004-add-internationalization-i18n/contracts/github-action-workflow.yml

Files to Create/Modify

  • .github/workflows/translate.yml (new)
  • .github/scripts/translate.js (new)

Deferred from i18n feature implementation. See kitty-specs/004-add-internationalization-i18n/tasks.md for full context.

コントリビューターガイド