diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index aff3a2bb..b0881591 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -87,7 +87,7 @@ const plugins = [ paths: ['api/**'], }, ], - exclude: ['ja/**', 'zh/**'], + exclude: ['ja/**', 'zh/**', 'ko/**'], }), ]; @@ -98,6 +98,7 @@ const sidebar = [ translations: { ja: '概要', zh: '概述', + ko: '개요', }, }, { @@ -106,6 +107,7 @@ const sidebar = [ translations: { ja: 'クイックスタート', zh: '快速开始', + ko: '빠른 시작', }, }, { @@ -113,6 +115,7 @@ const sidebar = [ translations: { ja: 'ガイド', zh: '指南', + ko: '가이드', }, items: [ { @@ -121,6 +124,7 @@ const sidebar = [ translations: { ja: 'エージェント', zh: '智能体', + ko: '에이전트', }, }, { @@ -129,6 +133,7 @@ const sidebar = [ translations: { ja: 'エージェントの実行', zh: '运行智能体', + ko: '에이전트 실행', }, }, { @@ -137,6 +142,7 @@ const sidebar = [ translations: { ja: 'エージェントの実行結果', zh: '执行结果', + ko: '실행 결과', }, }, { @@ -145,6 +151,7 @@ const sidebar = [ translations: { ja: 'ツール', zh: '工具', + ko: '도구', }, }, { @@ -153,6 +160,7 @@ const sidebar = [ translations: { ja: 'マルチエージェント', zh: '多智能体编排', + ko: '멀티 에이전트 오케스트레이션', }, }, { @@ -161,6 +169,7 @@ const sidebar = [ translations: { ja: 'ハンドオフ', zh: '交接', + ko: '핸드오프', }, }, { @@ -169,6 +178,7 @@ const sidebar = [ translations: { ja: 'コンテキスト管理', zh: '上下文管理', + ko: '컨텍스트 관리', }, }, { @@ -177,6 +187,7 @@ const sidebar = [ translations: { ja: 'モデル', zh: '模型', + ko: '모델', }, }, { @@ -185,6 +196,7 @@ const sidebar = [ translations: { ja: 'ガードレール', zh: '护栏', + ko: '가드레일', }, }, { @@ -193,6 +205,7 @@ const sidebar = [ translations: { ja: 'ストリーミング', zh: '流式传输', + ko: '스트리밍', }, }, { @@ -201,6 +214,7 @@ const sidebar = [ translations: { ja: '人間の介入(HITL)', zh: '人机协作', + ko: '휴먼 인 더 루프 (HITL)', }, }, { @@ -209,6 +223,7 @@ const sidebar = [ translations: { ja: 'MCP 連携', zh: 'MCP 集成', + ko: '모델 컨텍스트 프로토콜 (MCP)', }, }, { @@ -217,6 +232,7 @@ const sidebar = [ translations: { ja: 'トレーシング', zh: '追踪', + ko: '트레이싱', }, }, { @@ -225,6 +241,7 @@ const sidebar = [ translations: { ja: 'SDK の設定', zh: 'SDK 配置', + ko: 'SDK 설정', }, }, { @@ -233,6 +250,7 @@ const sidebar = [ translations: { ja: 'トラブルシューティング', zh: '故障排除', + ko: '문제 해결', }, }, { @@ -241,6 +259,7 @@ const sidebar = [ translations: { ja: 'リリースプロセス', zh: '发布流程', + ko: '릴리스 프로세스', }, }, ], @@ -250,6 +269,7 @@ const sidebar = [ translations: { ja: '音声エージェント', zh: '语音智能体', + ko: '음성 에이전트', }, items: [ { @@ -258,6 +278,7 @@ const sidebar = [ translations: { ja: '音声エージェントの概要', zh: '语音智能体概述', + ko: '음성 에이전트 개요', }, }, { @@ -266,6 +287,7 @@ const sidebar = [ translations: { ja: 'クイックスタート', zh: '快速开始', + ko: '빠른 시작', }, }, { @@ -274,6 +296,7 @@ const sidebar = [ translations: { ja: '音声エージェントの構築', zh: '构建语音智能体', + ko: '음성 에이전트 구축', }, }, { @@ -282,6 +305,7 @@ const sidebar = [ translations: { ja: 'リアルタイムトランスポート', zh: '传输机制', + ko: '전송 방식', }, }, ], @@ -291,6 +315,7 @@ const sidebar = [ translations: { ja: '拡張機能', zh: '扩展', + ko: '확장 기능', }, items: [ { @@ -299,6 +324,7 @@ const sidebar = [ translations: { ja: 'AI SDK で任意モデルを指定', zh: '使用 AI SDK 指定任意模型', + ko: 'AI SDK로 어떤 모델이든 사용', }, }, { @@ -307,6 +333,7 @@ const sidebar = [ translations: { ja: 'Realtime Agent を Twilio に接続', zh: '将实时智能体连接到 Twilio', + ko: 'Realtime 에이전트를 Twilio에 연결', }, }, { @@ -315,6 +342,7 @@ const sidebar = [ translations: { ja: 'Cloudflare Workers 用トランスポート', zh: 'Cloudflare Workers 传输', + ko: 'Cloudflare Workers 전송', }, }, ], @@ -324,6 +352,7 @@ const sidebar = [ translations: { ja: 'APIリファレンス', zh: 'API 参考', + ko: 'API 레퍼런스', }, collapsed: false, items: [ @@ -390,6 +419,10 @@ export default defineConfig({ label: '中文', lang: 'zh', }, + ko: { + label: '한국어', + lang: 'ko', + }, }, social: [ { diff --git a/docs/src/scripts/translate.ts b/docs/src/scripts/translate.ts index b44f42b5..19cfc157 100644 --- a/docs/src/scripts/translate.ts +++ b/docs/src/scripts/translate.ts @@ -123,6 +123,7 @@ export async function extractSidebarTranslations( const sourceDir = path.resolve(__dirname, '../../src/content/docs'); const languages: Record = { ja: 'Japanese', + ko: 'Korean', zh: 'Chinese', // Add more languages here }; @@ -213,6 +214,40 @@ const engToNonEngMapping: Record> = { Overview: '概述', Quickstart: '快速上手', }, + ko: { + agents: '에이전트', + 'computer use': '컴퓨터 사용', + 'OAI hosted tools': 'OpenAI 호스트하는 도구', + 'well formed data': '적절한 형식의 데이터', + guardrail: '가드레일', + handoffs: '핸드오프', + 'function tools': '함수 도구', + 'function calling': '함수 호출', + tracing: '트레이싱', + 'code examples': '코드 예제', + 'vector store': '벡터 스토어', + 'deep research': '딥 리서치', + category: '카테고리', + user: '사용자', + parameter: '매개변수', + processor: '프로세서', + 'orchestrating multiple agents': '멀티 에이전트 오케스트레이션', + server: '서버', + 'web search': '웹 검색', + 'file search': '파일 검색', + streaming: '스트리밍', + 'system prompt': '시스템 프롬프트', + interruption: '인터럽션(중단 처리)', + 'TypeScript-first': 'TypeScript 우선', + 'Human in the loop': '휴먼인더루프 (HITL)', + 'Hosted tool': '호스티드 툴', + 'Hosted MCP server tools': '호스티드 MCP 서버 도구', + raw: '원문', + 'Realtime Agents': '실시간 에이전트', + 'Build your first agent in minutes.': + '단 몇 분 만에 첫 에이전트를 만들 수 있습니다', + "Let's build": '시작하기', + }, }; const engToNonEngInstructions: Record = { @@ -234,6 +269,12 @@ const engToNonEngInstructions: Record = { '* Use Chinese punctuation marks appropriately (。,;:""\'\'())', '* When translating code-related content, maintain consistency with established Chinese programming terminology', ], + ko: [ + '* 공손하고 중립적인 문체(합니다/입니다체)를 일관되게 사용하세요.', + '* 개발자를 위한 페이지이므로 보통 개발자 문서 형식으로 번역하세요', + "* 'instructions', 'tools'와 같은 API 매개변수 이름과 temperature, top_p, max_tokens, presence_penalty, frequency_penalty 등은 영문 그대로 유지하세요.", + '* 문장이 아닌 불릿 항목 끝에는 마침표를 찍지 마세요.', + ], }; async function ensureDir(dir: string) { @@ -305,6 +346,10 @@ You must return **only** the translated markdown. Do not include any commentary, - Use simplified Chinese characters consistently - Follow Chinese grammar and sentence structure patterns +*(applies only when ${targetLanguage} = Korean)* +- 영문 식별자, 코드, 약어 주변의 공백은 원문을 유지하고 임의로 추가하거나 삭제하지 마세요. +- 마크다운 강조 표식 주변에 불필요한 공백을 넣지 마세요: `**굵게**` (good) vs `** 굵게 **` (bad). + ######################### ## DO NOT TRANSLATE ## ######################### @@ -439,6 +484,10 @@ You must return **only** the translated markdown. Do not include any commentary, - Use simplified Chinese characters consistently - Follow Chinese grammar and sentence structure patterns Review this rule again before returning the translated text. +*(applies only when ${targetLanguage} = Korean)* +- 영문 식별자, 코드, 약어 주변의 공백은 원문을 유지하고 임의로 추가하거나 삭제하지 마세요. +- 마크다운 강조 표식 주변에 불필요한 공백을 넣지 마세요: `**굵게**` (good) vs `** 굵게 **` (bad). + ######################### ## DO NOT TRANSLATE ## ######################### @@ -675,7 +724,8 @@ function shouldSkipFile(filePath: string): boolean { const rel = path.relative(sourceDir, filePath); if ( rel.startsWith('ja/') || - rel.startsWith('fr/') || + rel.startsWith('ko/') || + rel.startsWith('zh/') || (!filePath.endsWith('.md') && !filePath.endsWith('.mdx')) ) { return true;