Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const plugins = [
paths: ['api/**'],
},
],
exclude: ['ja/**', 'zh/**'],
exclude: ['ja/**', 'zh/**', 'ko/**'],
}),
];

Expand All @@ -98,6 +98,7 @@ const sidebar = [
translations: {
ja: '概要',
zh: '概述',
ko: '개요',
},
},
{
Expand All @@ -106,13 +107,15 @@ const sidebar = [
translations: {
ja: 'クイックスタート',
zh: '快速开始',
ko: '빠른 시작',
},
},
{
label: 'Guides',
translations: {
ja: 'ガイド',
zh: '指南',
ko: '가이드',
},
items: [
{
Expand All @@ -121,6 +124,7 @@ const sidebar = [
translations: {
ja: 'エージェント',
zh: '智能体',
ko: '에이전트',
},
},
{
Expand All @@ -129,6 +133,7 @@ const sidebar = [
translations: {
ja: 'エージェントの実行',
zh: '运行智能体',
ko: '에이전트 실행',
},
},
{
Expand All @@ -137,6 +142,7 @@ const sidebar = [
translations: {
ja: 'エージェントの実行結果',
zh: '执行结果',
ko: '실행 결과',
},
},
{
Expand All @@ -145,6 +151,7 @@ const sidebar = [
translations: {
ja: 'ツール',
zh: '工具',
ko: '도구',
},
},
{
Expand All @@ -153,6 +160,7 @@ const sidebar = [
translations: {
ja: 'マルチエージェント',
zh: '多智能体编排',
ko: '멀티 에이전트 오케스트레이션',
},
},
{
Expand All @@ -161,6 +169,7 @@ const sidebar = [
translations: {
ja: 'ハンドオフ',
zh: '交接',
ko: '핸드오프',
},
},
{
Expand All @@ -169,6 +178,7 @@ const sidebar = [
translations: {
ja: 'コンテキスト管理',
zh: '上下文管理',
ko: '컨텍스트 관리',
},
},
{
Expand All @@ -177,6 +187,7 @@ const sidebar = [
translations: {
ja: 'モデル',
zh: '模型',
ko: '모델',
},
},
{
Expand All @@ -185,6 +196,7 @@ const sidebar = [
translations: {
ja: 'ガードレール',
zh: '护栏',
ko: '가드레일',
},
},
{
Expand All @@ -193,6 +205,7 @@ const sidebar = [
translations: {
ja: 'ストリーミング',
zh: '流式传输',
ko: '스트리밍',
},
},
{
Expand All @@ -201,6 +214,7 @@ const sidebar = [
translations: {
ja: '人間の介入(HITL)',
zh: '人机协作',
ko: '휴먼 인 더 루프 (HITL)',
},
},
{
Expand All @@ -209,6 +223,7 @@ const sidebar = [
translations: {
ja: 'MCP 連携',
zh: 'MCP 集成',
ko: '모델 컨텍스트 프로토콜 (MCP)',
},
},
{
Expand All @@ -217,6 +232,7 @@ const sidebar = [
translations: {
ja: 'トレーシング',
zh: '追踪',
ko: '트레이싱',
},
},
{
Expand All @@ -225,6 +241,7 @@ const sidebar = [
translations: {
ja: 'SDK の設定',
zh: 'SDK 配置',
ko: 'SDK 설정',
},
},
{
Expand All @@ -233,6 +250,7 @@ const sidebar = [
translations: {
ja: 'トラブルシューティング',
zh: '故障排除',
ko: '문제 해결',
},
},
{
Expand All @@ -241,6 +259,7 @@ const sidebar = [
translations: {
ja: 'リリースプロセス',
zh: '发布流程',
ko: '릴리스 프로세스',
},
},
],
Expand All @@ -250,6 +269,7 @@ const sidebar = [
translations: {
ja: '音声エージェント',
zh: '语音智能体',
ko: '음성 에이전트',
},
items: [
{
Expand All @@ -258,6 +278,7 @@ const sidebar = [
translations: {
ja: '音声エージェントの概要',
zh: '语音智能体概述',
ko: '음성 에이전트 개요',
},
},
{
Expand All @@ -266,6 +287,7 @@ const sidebar = [
translations: {
ja: 'クイックスタート',
zh: '快速开始',
ko: '빠른 시작',
},
},
{
Expand All @@ -274,6 +296,7 @@ const sidebar = [
translations: {
ja: '音声エージェントの構築',
zh: '构建语音智能体',
ko: '음성 에이전트 구축',
},
},
{
Expand All @@ -282,6 +305,7 @@ const sidebar = [
translations: {
ja: 'リアルタイムトランスポート',
zh: '传输机制',
ko: '전송 방식',
},
},
],
Expand All @@ -291,6 +315,7 @@ const sidebar = [
translations: {
ja: '拡張機能',
zh: '扩展',
ko: '확장 기능',
},
items: [
{
Expand All @@ -299,6 +324,7 @@ const sidebar = [
translations: {
ja: 'AI SDK で任意モデルを指定',
zh: '使用 AI SDK 指定任意模型',
ko: 'AI SDK로 어떤 모델이든 사용',
},
},
{
Expand All @@ -307,6 +333,7 @@ const sidebar = [
translations: {
ja: 'Realtime Agent を Twilio に接続',
zh: '将实时智能体连接到 Twilio',
ko: 'Realtime 에이전트를 Twilio에 연결',
},
},
{
Expand All @@ -315,6 +342,7 @@ const sidebar = [
translations: {
ja: 'Cloudflare Workers 用トランスポート',
zh: 'Cloudflare Workers 传输',
ko: 'Cloudflare Workers 전송',
},
},
],
Expand All @@ -324,6 +352,7 @@ const sidebar = [
translations: {
ja: 'APIリファレンス',
zh: 'API 参考',
ko: 'API 레퍼런스',
},
collapsed: false,
items: [
Expand Down Expand Up @@ -390,6 +419,10 @@ export default defineConfig({
label: '中文',
lang: 'zh',
},
ko: {
label: '한국어',
lang: 'ko',
},
},
social: [
{
Expand Down
52 changes: 51 additions & 1 deletion docs/src/scripts/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export async function extractSidebarTranslations(
const sourceDir = path.resolve(__dirname, '../../src/content/docs');
const languages: Record<string, string> = {
ja: 'Japanese',
ko: 'Korean',
zh: 'Chinese',
// Add more languages here
};
Expand Down Expand Up @@ -213,6 +214,40 @@ const engToNonEngMapping: Record<string, Record<string, string>> = {
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<string, string[]> = {
Expand All @@ -234,6 +269,12 @@ const engToNonEngInstructions: Record<string, string[]> = {
'* 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) {
Expand Down Expand Up @@ -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 ##
#########################
Expand Down Expand Up @@ -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 ##
#########################
Expand Down Expand Up @@ -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;
Expand Down