MonkeyCode 多语言支持:让 AI 编程助手服务全球开发者
引言
"代码没有国界,但开发者有母语。"
在全球超过 2700 万 开发者中,使用英语作为主要工作语言的仅占约 55%。MonkeyCode 自开源以来就致力于打破语言壁垒——不仅支持多种编程语言,更支持多语言界面、多语言文档、多语言提示词理解,让每一位开发者都能用最舒适的方式与 AI 协作编程。
本文将全面介绍 MonkeyCode 的国际化(i18n)能力——从 UI 本地化到代码注释翻译,从多语言错误信息到跨文化提示词优化。
🎯 核心信息
- GitHub 仓库: https://github.com/monkeycode-ai/monkeycode
- Discord 社区: https://discord.gg/monkeycode (支持 #english #中文 #日本語 #한국어 频道)
- 欢迎提交 Issue: https://github.com/monkeycode-ai/monkeycode/issues
- 开源协议: Apache License 2.0
一、全球开发者语言分布
1.1 开发者语言现状
┌─────────────────────────────────────────────────────────────┐
│ 全球开发者母语分布 (2026 Stack Overflow 调研) │
├──────────┬──────────┬───────────┬───────────────────────────┤
│ 语言 │ 占比 │ 开发者数量 │ MonkeyCode 支持状态 │
├──────────┼──────────┼───────────┼───────────────────────────┤
│ 🇺🇸 英语 │ 55.0% │ ~1485万 │ ✅ 完整支持 (默认) │
│ 🇨🇳 中文 │ 12.3% │ ~332万 │ ✅ 完整支持 │
│ 🇮🇳 印地语 │ 6.5% │ ~175万 │ 🔄 UI 翻译中 │
│ 🇪🇸 西班牙语│ 5.8% │ ~157万 │ ✅ 完整支持 │
│ 🇯🇵 日语 │ 4.2% │ ~113万 │ ✅ 完整支持 │
│ 🇩🇪 德语 │ 3.1% │ ~84万 │ ✅ 基础支持 │
│ 🇫🇷 法语 │ 2.8% │ ~76万 │ ✅ 基础支持 │
│ 🇧🇷 葡萄牙语│ 2.5% │ ~68万 │ 🔄 UI 翻译中 │
│ 🇰🇷 韩语 │ 2.1% │ ~57万 │ ✅ 完整支持 │
│ 🇷🇺 俄语 │ 1.9% │ ~51万 │ ⏳ 计划中 │
│ 🇹🇷 土耳其语│ 1.5% │ ~40万 │ ⏳ 计划中 │
│ 🇻🇳 越南语 │ 1.3% │ ~35万 │ ⏳ 计划中 │
│ 其他 │ 1.0% │ ~27万 │ — │
└──────────┴──────────┴───────────┴───────────────────────────┘
1.2 为什么多语言对 AI 编程工具至关重要?
| 场景 | 单语限制 | 多语言价值 |
|---|---|---|
| 错误信息理解 | 英文报错 → 查字典 → 理解偏差 | 母语直接理解 → 快速定位 |
| 提示词编写 | 需要英文思维转换 | 用母语描述需求 → AI 准确理解 |
| 文档阅读 | 语言障碍导致学习曲线陡峭 | 本地化文档降低入门门槛 |
| 代码注释 | 团队内部语言不一致 | AI 统一生成目标语言注释 |
| 技术交流 | 国际社区参与门槛高 | 多语言 Discord/论坛 降低门槛 |
二、UI 界面本地化
2.1 支持的语言列表
| 语言 | 代码 | UI 支持 | 文档支持 | 提示词理解 | 状态 |
|---|---|---|---|---|---|
| 🇺🇸 English | en-US |
✅ 100% | ✅ 100% | ✅ 100% | 默认 |
| 🇨🇳 简体中文 | zh-CN |
✅ 100% | ✅ 100% | ✅ 100% | 完整 |
| 🇹🇼 繁體中文 | zh-TW |
✅ 95% | ✅ 90% | ✅ 95% | 完整 |
| 🇯🇵 日本語 | ja-JP |
✅ 100% | ✅ 95% | ✅ 95% | 完整 |
| 🇰🇷 한국어 | ko-KR |
✅ 95% | ✅ 85% | ✅ 90% | 完整 |
| 🇪🇸 Español | es-ES |
✅ 90% | ✅ 80% | ✅ 85% | 良好 |
| 🇩🇪 Deutsch | de-DE |
✅ 85% | ✅ 75% | ✅ 80% | 良好 |
| 🇫🇷 Français | fr-FR |
✅ 85% | ✅ 75% | ✅ 80% | 良好 |
| 🇧🇷 Português | pt-BR |
🔄 70% | 🔄 60% | ✅ 75% | 开发中 |
| 🇮🇳 हिन्दी | hi-IN |
🔄 50% | 🔄 40% | ✅ 70% | 开发中 |
2.2 i18n 架构设计
// ===== MonkeyCode 国际化架构 =====
/**
* 核心国际化模块
*
* 设计原则:
* 1. 零运行时开销的静态提取
* 2. 支持插值和复数形式
* 3. RTL(从右到左)语言预留
* 4. 懒加载语言包
*/
class I18nManager {
private currentLocale: string;
private fallbackLocale = 'en-US';
private translations: Map<string, TranslationBundle> = new Map();
private listeners: Set<LocaleChangeListener> = new Set();
constructor() {
// 检测浏览器语言或读取用户偏好
this.currentLocale = this.detectLocale();
}
/**
* 检测用户首选语言
* 优先级:用户设置 > 浏览器语言 > 系统语言 > 默认英语
*/
private detectLocale(): string {
const stored = localStorage.getItem('monkeycode-locale');
if (stored && this.isSupported(stored)) return stored;
const browserLangs = navigator.languages || [navigator.language];
for (const lang of browserLangs) {
const matched = this.findBestMatch(lang);
if (matched) return matched;
}
return this.fallbackLocale;
}
/**
* 翻译文本(支持插值和复数)
*/
t(key: string, params?: Record<string, any>, count?: number): string {
const bundle = this.translations.get(this.currentLocale)
|| this.translations.get(this.fallbackLocale)!;
let template = bundle[key] || key;
// 处理复数形式
if (count !== undefined && typeof template === 'object') {
template = this.pluralize(template, count, this.currentLocale);
}
// 处理插值
if (params) {
Object.entries(params).forEach(([k, v]) => {
template = template.replace(new RegExp(`\\{${k}\\}`, 'g'), String(v));
});
}
return template;
}
/**
* 切换语言
*/
async setLocale(locale: string): Promise<void> {
if (!this.isSupported(locale)) {
throw new Error(`Unsupported locale: ${locale}`);
}
// 懒加载语言包
if (!this.translations.has(locale)) {
await this.loadLocale(locale);
}
this.currentLocale = locale;
localStorage.setItem('monkeycode-locale', locale);
// 更新 HTML lang 属性
document.documentElement.lang = locale;
// 设置文字方向(RTL 支持)
const dir = this.isRTL(locale) ? 'rtl' : 'ltr';
document.documentElement.dir = dir;
// 通知所有监听者
this.listeners.forEach(listener => listener(locale));
}
/**
* 复数形式处理(不同语言规则不同)
*/
private pluralize(
forms: { one?: string; other?: string; zero?: string; few?: string; many?: string },
count: number,
locale: string
): string {
const rules: Record<string, (n: number) => string> = {
'en-US': n => (n === 1 ? forms.one : forms.other),
'zh-CN': n => forms.other, // 中文无复数变化
'ja-JP': n => forms.other, // 日文无复数变化
'ko-KR': n => forms.other,
'ru-RU': n => {
const mod10 = n % 10, mod100 = n % 100;
if (mod10 === 1 && mod100 !== 11) return forms.one || '';
if ([2,3,4].includes(mod10) && ![12,13,14].includes(mod100)) return forms.few || '';
return forms.many || forms.other || '';
},
'pl-PL': n => (n === 1 ? forms.one : [2,3,4].includes(n % 10) ? forms.few : forms.many || forms.other),
};
const rule = rules[locale] || rules['en-US'];
return rule(count) || forms.other || '';
}
private isRTL(locale: string): boolean {
return ['ar-SA', 'he-IL', 'fa-IR', 'ur-PK'].includes(locale);
}
private findBestMatch(lang: string): string | null {
// 精确匹配
if (this.isSupported(lang)) return lang;
// 匹配语言前缀(如 zh-TW -> zh-CN)
const prefix = lang.split('-')[0];
const match = this.getSupportedLocales().find(l => l.startsWith(prefix));
return match || null;
}
}
// ===== 语言包示例 =====
const zhCN: TranslationBundle = {
// 通用
'common.confirm': '确认',
'common.cancel': '取消',
'common.save': '保存',
'common.delete': '删除',
'common.loading': '加载中...',
'common.error': '出错了',
'common.success': '操作成功',
// 编辑器
'editor.placeholder': '在此输入你的代码或描述你想要的功能...',
'editor.complete': '补全',
'editor.generate': '生成',
'editor.explain': '解释',
'editor.refactor': '重构',
'editor.fix': '修复',
'editor.optimize': '优化',
// 提示词相关
'prompt.suggestions': '建议',
'prompt.examples': '示例',
'prompt.custom': '自定义指令',
// 错误信息
'error.network': '网络连接失败,请检查网络后重试',
'error.rate_limit': '请求过于频繁,请稍后再试',
'error.auth_expired': '登录已过期,请重新登录',
'error.model_unavailable': '当前模型暂时不可用,请稍后重试或切换模型',
'error.context_too_long': '上下文过长,请减少输入内容或分割任务',
// 统计(复数)
'stats.lines_generated': {
one: '已生成 {count} 行代码',
other: '已生成 {count} 行代码'
},
'stats.time_saved': {
one: '预计节省约 {count} 分钟',
other: '预计节省约 {count} 分钟'
},
};
const enUS: TranslationBundle = {
'common.confirm': 'Confirm',
'common.cancel': 'Cancel',
'common.save': 'Save',
'common.delete': 'Delete',
'common.loading': 'Loading...',
'common.error': 'Something went wrong',
'common.success': 'Success',
'editor.placeholder': 'Enter your code or describe what you want to build...',
'editor.complete': 'Complete',
'editor.generate': 'Generate',
'editor.explain': 'Explain',
'editor.refactor': 'Refactor',
'editor.fix': 'Fix',
'editor.optimize': 'Optimize',
'prompt.suggestions': 'Suggestions',
'prompt.examples': 'Examples',
'prompt.custom': 'Custom Instructions',
'error.network': 'Network error. Please check your connection and try again.',
'error.rate_limit': 'Too many requests. Please wait a moment and try again.',
'error.auth_expired': 'Session expired. Please log in again.',
'error.model_unavailable': 'Model is temporarily unavailable. Try later or switch models.',
'error.context_too_long': 'Context too long. Reduce input or split into smaller tasks.',
'stats.lines_generated': {
one: '{count} line generated',
other: '{count} lines generated'
},
'stats.time_saved': {
one: '~{count} minute saved',
other: '~{count} minutes saved'
},
};
三、多语言提示词理解
3.1 跨语言语义映射
// ===== 多语言提示词处理器 =====
/**
* 将用户的自然语言请求转换为统一的内部表示
* 无论用户用中文、日文、韩文还是西班牙语提问,
* 都能准确理解意图并生成正确的代码
*/
class MultilingualPromptProcessor {
private translator: NeuralTranslator;
private intentClassifier: IntentClassifier;
/**
* 处理多语言提示词
*/
async process(prompt: string, sourceLang: string): Promise<ProcessedPrompt> {
// 1. 检测语言(如果未指定)
const detectedLang = sourceLang || await this.detectLanguage(prompt);
// 2. 意图分类(在原始语言上进行)
const intent = await this.classifyIntent(prompt, detectedLang);
// 3. 提取关键实体
const entities = await this.extractEntities(prompt, detectedLang);
// 4. 翻译为标准英语内部表示(保留技术术语)
const normalizedPrompt = await this.normalizeToEnglish(
prompt,
detectedLang,
entities.technicalTerms // 技术术语不翻译
);
// 5. 生成结构化的代码请求
return {
original: prompt,
originalLanguage: detectedLang,
normalized: normalizedPrompt,
intent,
entities,
confidence: this.calculateConfidence(intent, detectedLang),
};
}
/**
* 多语言意图分类示例
*/
async classifyIntent(text: string, lang: string): Promise<Intent> {
// 不同语言的同一意图示例:
const intentExamples: Record<string, Record<string, string[]>> = {
'generate_code': {
'zh-CN': ['写一个函数', '帮我实现', '生成代码', '创建一个类'],
'en-US': ['write a function', 'implement', 'generate code', 'create a class'],
'ja-JP': ['関数を書いて', '実装して', 'コードを生成', 'クラスを作成'],
'ko-KR': ['함수를 작성해줘', '구현해줘', '코드 생성', '클래스 만들기'],
'es-ES': ['escribe una función', 'implementar', 'generar código', 'crear una clase'],
},
'explain_code': {
'zh-CN': ['解释一下', '这段代码什么意思', '帮我理解', '说明这个函数'],
'en-US': ['explain', 'what does this code do', 'help me understand', 'describe this function'],
'ja-JP': ['説明して', 'このコードの意味は', '理解するのを手伝って', 'この関数を説明'],
'ko-KR': ['설명해줘', '이 코드가 뭔 의미야', '이해하는 거 도와줘', '이 함수 설명'],
},
'fix_bug': {
'zh-CN': ['修复bug', '这段代码有错', '帮我改一下', '找出问题'],
'en-US': ['fix bug', 'this code has an error', 'help me fix', 'find the issue'],
'ja-JP': ['バグ修正', 'このコードは間違っている', '直して', '問題を見つけて'],
'ko-KR': ['버그 수정', '이 코드 오류 있어', '고쳐줘', '문제 찾아줘'],
},
'refactor': {
'zh-CN': ['重构', '优化代码', '改进写法', '让代码更简洁'],
'en-US': ['refactor', 'optimize', 'improve', 'make it cleaner'],
'ja-JP': ['リファクタリング', '最適化', '改善', 'きれいに書き直して'],
'ko-KR': ['리팩토링', '최적화', '개선', '깔끔하게 다시 쓰기'],
},
};
// 使用语义相似度匹配意图
// (实际实现中使用 embedding 模型)
return this.matchIntent(text, intentExamples, lang);
}
}
// ===== 使用示例 =====
/*
用户输入(各种语言)→ 统一输出:
🇨🇳 中文: "帮我写一个快速排序算法,要求时间复杂度 O(n log n)"
🇺🇸 English: "Write a quicksort algorithm with O(n log n) time complexity"
🇯🇵 日文: "クイックソートアルゴリズムを書いてください。時間計算量は O(n log n) で"
🇰🇷 韩文: "퀵소트 알고리즘 작성해줘. 시간 복잡도는 O(n log n)"
↓ 全部转换为 ↓
统一内部表示:
{
intent: "generate_algorithm",
algorithm: "quicksort",
constraints: [
{ type: "time_complexity", value: "O(n log n)" }
],
language: "auto_detect", // 自动选择合适的编程语言
}
*/
3.2 代码注释多语言生成
/*
以下是一段 TypeScript 代码,请为它生成:
1. 中文注释版本
2. 英文注释版本
3. 日文注释版本
源代码:
function debounce<T extends (...args: any[]) => any>(
fn: T,
delay: number
): (...args: Parameters<T>) => void {
let timer: ReturnType<typeof setTimeout> | null = null;
return function(this: any, ...args: Parameters<T>) {
if (timer) clearTimeout(timer);
timer = setTimeout(() => fn.apply(this, args), delay);
};
}
*/
// ===== 🇨🇳 中文注释版本 =====
/**
* 防抖函数 —— 限制高频调用,只在最后一次触发后等待指定时间才执行
*
* @template T - 被包装的函数类型
* @param fn - 需要防抖的目标函数
* @param delay - 防抖延迟时间(毫秒)
* @returns 包装后的防抖函数
*
* @example
* ```ts
* // 搜索框输入防抖:用户停止输入 300ms 后才发送请求
* const debouncedSearch = debounce((query: string) => {
* fetchSearchResults(query);
* }, 300);
*
* searchInput.addEventListener('input', (e) => {
* debouncedSearch(e.target.value);
* });
* ```
*
* @remarks
* 典型应用场景:
* - 窗口 resize 事件处理
* - 搜索框实时搜索
* - 表单输入验证
* - 按钮防止重复点击
*/
function debounce<T extends (...args: any[]) => any>(
fn: T,
delay: number
): (...args: Parameters<T>) => void {
let timer: ReturnType<typeof setTimeout> | null = null; // 定时器引用
return function(this: any, ...args: Parameters<T>) {
if (timer) clearTimeout(timer); // 清除上一次的定时器(重置倒计时)
timer = setTimeout(() => fn.apply(this, args), delay); // 重新设定定时器
};
}
// ===== 🇺🇸 English Comment Version =====
/**
* Debounce function — limits high-frequency invocations, executing only after
* a specified delay since the last trigger.
*
* @template T - The type of the function to be wrapped
* @param fn - The target function to debounce
* @param delay - Debounce delay in milliseconds
* @returns The debounced wrapper function
*
* @example
* ```ts
* // Search input debounce: sends request only after user stops typing for 300ms
* const debouncedSearch = debounce((query: string) => {
* fetchSearchResults(query);
* }, 300);
*
* searchInput.addEventListener('input', (e) => {
* debouncedSearch(e.target.value);
* });
* ```
*
* @remarks
* Common use cases:
* - Window resize event handling
* - Real-time search input
* - Form input validation
* - Button click prevention (double-click guard)
*/
// ===== 🇯🇵 日本語コメント版 =====
/**
* デバンス関数 —— 高頻度の呼び出しを制限し、最後のトリガーから指定時間経過後にのみ実行します
*
* @template T - ラップ対象の関数型
* @param fn - デバンス対象の関数
* @param delay - デバンス遅延時間(ミリ秒)
* @returns デバンスされたラッパー関数
*
* @example
* ```ts
* // 検索入力デバンス:ユーザーが入力停止後300msでリクエスト送信
* const debouncedSearch = debounce((query: string) => {
* fetchSearchResults(query);
* }, 300);
* ```
*
* @remarks
* 主な用途:
* - ウィンドウリサイズイベント処理
* - リアルタイム検索入力
* - フォーム入力バリデーション
* - ボタン二重クリック防止
*/
四、文档多语言方案
4.1 文档翻译工作流
# .github/workflows/doc-i18n.yml
name: Documentation Internationalization
on:
push:
paths:
- 'docs/en/**' # 英文原文更新时触发翻译
workflow_dispatch:
inputs:
target_lang:
description: 'Target language to translate to'
required: true
default: 'zh-CN'
type: choice
options:
- zh-CN
- ja-JP
- ko-KR
- es-ES
- de-DE
- fr-FR
jobs:
translate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install MonkeyCode CLI
run: npm install -g @monkeycode/cli
- name: Translate documentation
env:
MONKEYCODE_API_KEY: ${{ secrets.MONKEYCODE_API_KEY }}
run: |
monkeycode i18n translate \
--source docs/en/ \
--target docs/${{ github.event.inputs.target_lang || 'zh-CN' }}/ \
--format markdown \
--preserve-code-blocks \
--preserve-frontmatter \
--tech-term-glossary .i18n/glossary.yml \
--review-mode \
--create-pr \
--pr-branch "i18n/update-${{ github.event.inputs.target_lang || 'zh-CN' }}"
- name: Verify translation quality
run: |
monkeycode i18n verify \
--source docs/en/ \
--target docs/${{ github.event.inputs.target_lang || 'zh-CN' }}/ \
--min-quality-score 0.85
4.2 技术术语表管理
# .i18n/glossary.yml
# MonkeyCode 技术术语表 —— 确保术语翻译一致性
version: "1.0"
terms:
# ===== 核心概念 =====
MonkeyCode:
zh-CN: MonkeyCode # 品牌名保持不变
ja-JP: MonkeyCode
ko-KR: MonkeyCode
Completion:
zh-CN: 代码补全
ja-JP: コード補完
ko-KR: 코드 완성
es-ES: Completado de código
de-DE: Codevervollständigung
Context Window:
zh-CN: 上下文窗口
ja-JP: コンテキストウィンドウ
ko-KR: 컨텍스트 윈도우
es-ES: Ventana de contexto
de-DE: Kontextfenster
Token:
zh-CN: Token
ja-JP: トークン
ko-KR: 토큰
es-ES: Token
de-DE: Token
Prompt:
zh-CN: 提示词 / Prompt
ja-JP: プロンプト
ko-KR: 프롬프트
es-ES: Prompt
de-DE: Prompt
Fine-tuning:
zh-CN: 微调
ja-JP: ファインチューニング
ko-KR: 파인튜닝
es-ES: Ajuste fino
de-DE: Feinabstimmung
Inference:
zh-CN: 推理
ja-JP: 推論
ko-KR: 추론
es-ES: Inferencia
de-DE: Inferenz
Embedding:
zh-CN: 嵌入向量
ja-JP: 埋め込み
ko-KR: 임베딩
es-ES: Incrustación
de-DE: Einbettung
RAG (Retrieval-Augmented Generation):
zh-CN: 检索增强生成 (RAG)
ja-JP: 検索拡張生成 (RAG)
ko-KR: 검색 증강 생성 (RAG)
es-ES: Generación Recuperada Aumentada (RAG)
de-DE: Abrufverstärkte Generierung (RAG)
# ===== 编程术语(通常保持英文)=====
keep_english:
- API
- SDK
- CLI
- IDE
- JSON
- YAML
- REST
- GraphQL
- Docker
- Kubernetes
- GitHub
- npm
- TypeScript
- JavaScript
- Python
- React
- Node.js
五、错误信息本地化
5.1 分级错误消息系统
// ===== 多语言错误消息系统 =====
/**
* 结构化错误消息,支持多语言 + 上下文感知
*/
class LocalizedError extends Error {
public code: ErrorCode;
public severity: ErrorSeverity;
public context: ErrorContext;
public suggestions: string[];
public docUrl?: string;
constructor(
code: ErrorCode,
locale: string = 'en-US',
context?: Partial<ErrorContext>
) {
// 获取本地化消息
const message = getLocalizedMessage(code, locale, context);
super(message);
this.name = 'MonkeyCodeError';
this.code = code;
this.severity = getErrorSeverity(code);
this.context = { ...getDefaultContext(code), ...context };
this.suggestions = getSuggestions(code, locale);
this.docUrl = getDocUrl(code, locale);
}
/**
* 转换为用户友好的显示格式
*/
toDisplayFormat(): ErrorDisplay {
return {
title: getErrorTitle(this.code, this.context.locale),
message: this.message,
severity: this.severity,
icon: getSeverityIcon(this.severity),
suggestions: this.suggestions,
docLink: this.docUrl,
errorCode: this.code,
timestamp: new Date().toISOString(),
};
}
}
// ===== 错误消息定义 =====
const ERROR_MESSAGES: Record<ErrorCode, LocaleMessages> = {
'AUTH_TOKEN_EXPIRED': {
'en-US': {
title: 'Session Expired',
message: 'Your authentication session has expired. Please log in again to continue.',
suggestions: [
'Click here to re-login',
'If the problem persists, clear your browser cache and try again',
],
},
'zh-CN': {
title: '登录已过期',
message: '您的认证会话已过期,请重新登录后继续使用。',
suggestions: [
'点击此处重新登录',
'如果问题仍然存在,请清除浏览器缓存后重试',
],
},
'ja-JP': {
title: 'セッションの有効期限切れ',
message: '認証セッションの有効期限が切れました。再度ログインしてください。',
suggestions: [
'ここをクリックして再ログイン',
'問題が解決しない場合は、ブラウザキャッシュを消去して再試行してください',
],
},
'ko-KR': {
title: '세션 만료됨',
message: '인증 세션이 만료되었습니다. 다시 로그인해 주세요.',
suggestions: [
'여기를 클릭하여 재로그인',
'문제가 지속되면 브라우저 캐시를 지우고 다시 시도하세요',
],
},
},
'RATE_LIMIT_EXCEEDED': {
'en-US': {
title: 'Rate Limit Exceeded',
message: 'You\'ve made too many requests. Please wait {retryAfter} seconds before trying again.',
suggestions: [
'Reduce the frequency of your requests',
'Consider batching multiple operations',
'Upgrade to Pro for higher rate limits',
],
},
'zh-CN': {
title: '请求频率超限',
message: '您的请求过于频繁,请在 {retryAfter} 秒后重试。',
suggestions: [
'降低请求频率',
'考虑将多个操作合并批量执行',
'升级到 Pro 版本以获得更高的频率限制',
],
},
'ja-JP': {
title: 'レート制限超過',
message: 'リクエストが多すぎます。{retryAfter}秒待ってから再試行してください。',
suggestions: [
'リクエスト頻度を下げる',
'複数の操作を一括で実行することを検討',
'Proプランにアップグレードして制限緩和',
],
},
},
'MODEL_CONTEXT_OVERFLOW': {
'en-US': {
title: 'Context Too Long',
message: 'The total content ({currentTokens} tokens) exceeds the model\'s context limit ({maxTokens} tokens).',
suggestions: [
'Split your request into smaller parts',
'Remove unnecessary code or comments',
'Use "@file" references instead of pasting large files',
],
},
'zh-CN': {
title: '上下文超出限制',
message: '当前内容总量({currentTokens} tokens)已超过模型的上下文窗口上限({maxTokens} tokens)。',
suggestions: [
'将请求拆分为较小的部分',
'移除不必要的代码或注释',
'使用"@文件引用"代替粘贴大段代码',
],
},
},
};
六、社区多语言建设
6.1 多语言频道架构
| 平台 | 频道 | 语言 | 用途 | 活跃度 |
|---|---|---|---|---|
| Discord | #general | 🌐 English | 主要讨论区 | 🔥 高 |
| Discord | #中文 | 🇨🇳 中文 | 中文用户交流 | 🔥 高 |
| Discord | #日本語 | 🇯🇵 日文 | 日本ユーザー向け | 🟡 中 |
| Discord | #한국어 | 🇰🇷 韩文 | 한국 사용자용 | 🟡 中 |
| Discord | #español | 🇪🇸 西班牙语 | Usuarios hispanohablantes | 🟢 低 |
| GitHub Discussions | All | 🌐 多语言 | 深度技术讨论 | 🔥 高 |
6.2 多语言贡献指南
<!--
MonkeyCode 多语言贡献指南
感谢你对 MonkeyCode 国际化的贡献!
## 如何贡献翻译?
### 方式一:通过 GitHub PR(推荐)
1. Fork 仓库
2. 找到需要翻译的文件:
- UI 翻译: `packages/ui/src/i18n/locales/{lang}.ts`
- 文档翻译: `docs/{lang}/`
- 错误消息: `packages/core/src/errors/messages/{lang}.ts`
3. 完成翻译后提交 PR
4. 在 PR 描述中标注语言代码
### 方式二:通过 Crowdin(即将上线)
访问 https://crowd.in/monkeycode 在线协作翻译
## 翻译规范
1. **术语一致性**: 参考 `.i18n/glossary.yml`
2. **语气友好**: 使用正式但不生硬的表达
3. **避免直译**: 理解含义后用地道的表达
4. **保留占位符**: 不要修改 `{variable}` 格式的变量
5. **技术术语**: 列表中的术语保持英文原文
## 质量标准
- 翻译覆盖率 > 90%
- 机器翻译需人工校对
- 通过 native speaker review(如有)
## 贡献者权益
- 翻译贡献者名字出现在对应语言版的 README 中
- 季度评选"最佳翻译贡献者",奖励 MonkeyCode 周边
-->
七、参与多语言建设的帮助
我们需要的帮助
| 方向 | 说明 | 适合谁 |
|---|---|---|
| 🌍 新语言翻译 | 添加更多语言支持(印地语、阿拉伯语、泰语等) | 双语开发者 |
| ✍️ 文档翻译 | 将英文文档翻译为各语言版本 | 技术写作者/译者 |
| 🎙️ 视频字幕 | 为教程视频添加多语言字幕 | 视频创作者 |
| 👄 口语支持 | 在 Discord 多语言频道答疑 | 社区志愿者 |
| 🧪 语言测试 | 测试各语言版本的显示效果 | QA 工程师 |
| 📚 术语维护 | 更新技术术语表,确保一致性 | 领域专家 |
立即参与!
👉 GitHub: https://github.com/monkeycode-ai/monkeycode
👉 Discord: https://discord.gg/monkeycode
👉 提交 Issue: https://github.com/monkeycode-ai/monkeycode/issues/new?labels=i18n
结语
"好的工具应该说用户的语言,而不是强迫用户学习工具的语言。"
MonkeyCode 相信,AI 编程助手的强大不应该被语言壁垒所削弱。无论你说中文、日语、韩语、西班牙语还是任何其他语言,MonkeyCode 都致力于让你用最自然的方式表达编程意图,获得最精准的 AI 辅助。
如果你擅长的语言还没有得到完善的支持,欢迎加入我们——让我们一起让 MonkeyCode 服务全球每一位开发者! 🌍✨
本文由 MonkeyCode 国际化团队原创,采用 Apache 2.0 许可证发布。
关键词: MonkeyCode 多语言 国际化 i18n 本地化 AI编程助手 开源 全球化 开发者
浙公网安备 33010602011771号