← 返回
未分类

常见语言翻译

Translate text between 15+ languages with high accuracy. Supports single/batch translation, automatic language detection, multiple translation methods (API/AI), and rich output formats. Use when user needs translation, language conversion, or multi-language text processing. Trigger keywords: 翻译, translate, 翻译成, translation, language exchange.
Translate text between 15+ languages with high accuracy. Supports single/batch translation, automatic language detection, multiple translation methods (API/AI), and rich output formats. Use when user needs translation, language conversion, or multi-language text processing. Trigger keywords: 翻译, translate, 翻译成, translation, language exchange.
user_d39ac014
未分类 community v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 97
下载
💾 0
安装
1
版本
#latest

概述

Translator

Overview

Professional translation skill supporting 15+ languages with advanced features:

  1. Single Translation - Translate one piece of text
  2. Batch Translation - Translate multiple texts at once
  3. Auto Language Detection - Automatic source language detection
  4. Multiple Translation Methods - API-based and AI-based translation
  5. Rich Output Formats - Plain text, with source, detailed results

Supported Languages (15+)

LanguageCodeNative Name
-----------------------------
Chinese (Simplified)zh中文(简体)
Chinese (Traditional)zh-TW中文(繁體)
EnglishenEnglish
Japaneseja日本語
Koreanko한국어
RussianruРусский
Arabicarالعربية
FrenchfrFrançais
GermandeDeutsch
SpanishesEspañol
ItalianitItaliano
PortugueseptPortuguês
Thaithไทย
VietnameseviTiếng Việt
Hindihiहिन्दी

Quick Start

Single Translation

User: "把'你好世界'翻译成英文"
→ "Hello World"

Batch Translation

User: "把以下内容翻译成日文:
苹果 - Apple
香蕉 - Banana
橙子 - Orange"
→ 苹果 - リンゴ
香蕉 - バナナ
オレンジ - オレンジ

Language Detection

User: "Translate: Bonjour le monde"
→ Auto-detect: French → "Hello World"

Core Workflow

Step 1: Detect Translation Intent

Trigger Keywords:

  • "翻译" / "translate" / "翻译成" / "translation"
  • "用XX语怎么说" / "How do you say X in XX"
  • "Language exchange" / "convert to XX"

Detection Patterns:

  • Explicit: "翻译成英文"
  • Implicit: "这段话用日语怎么说"

Step 2: Parse Request

  1. Identify text to translate (single or multiple)
  2. Identify target language (explicit or implicit)
  3. Identify source language (explicit or auto-detect)
  4. Determine translation mode (single/batch)

Step 3: Process Translation

Priority:

  1. Try API-based translation (if API key configured)
  2. Fallback to Claude-based translation
  3. Return formatted result

Step 4: Format Output

Output Formats:

Simple (default):

[translated text]

With Source:

原文(中文):你好世界
翻译(英文):Hello World

Detailed:

原文:你好世界
源语言:中文
目标语言:English
翻译结果:Hello World
翻译方式:AI-based (Claude)

Advanced Features

Batch Translation

For multiple texts, process efficiently:

Input: "翻译成韩文:
- 你好
- 谢谢
- 对不起"

Output:
- 你好 → 안녕하세요
-谢谢 → 고마워요
- 对不起 → 죄송합니다

Best practices for batch:

  • Use bullet points or numbered lists
  • Keep each item concise
  • Format consistently

Auto Language Detection

The skill automatically detects source language when not specified:

User: "Translate: Hello World to Chinese"
→ Detect: English → "你好世界"

Supported detection: zh, en, ja, ko, ru, ar, fr, de, es

Error Recovery

If translation fails:

  1. Try alternative translation method
  2. Provide partial results if possible
  3. Suggest fixes for configuration issues

Example error handling:

原文:[text]
错误:Translation API unavailable
备选:Using AI translation
结果:[translated text]

API Configuration (Optional)

Quick Setup

Option 1: Google Translate (Free Tier)

# scripts/translate.py 中设置
api_service = 'google'
# 需要: pip install google-cloud-translate

Option 2: DeepL API

# 设置环境变量
import os
os.environ['DEEPL_API_KEY'] = 'your-key'
api_service = 'deepl'

Option 3: LibreTranslate (Free/Open Source)

api_service = 'libre'
os.environ['LIBRETRANSLATE_URL'] = 'https://libretranslate.com'

No Configuration Required:

If no API is configured, Claude provides reliable AI-based translation automatically.

Usage Examples

Example 1: Simple Translation

Input: "把'谢谢'翻译成英文"

Output: "Thank you"

Example 2: Target Language in Text

Input: "翻译成日文:今天天气很好"

Output: 今日は天気がとても良いですね

Example 3: Batch with Format

Input: "翻译成韩文:

苹果

香蕉

橙子"

Output:

  • 苹果 → 사과

-香蕉 → 바나나

  • オレンジ → 오렌지

Example 4: Language Detection

Input: "Translate: Guten Morgen to Chinese"

Output: 早上好

Example 5: Phrase Translation

Input: "用日语说'祝你生日快乐'"

Output: お誕生日おめでとうございます

Example 6: Formal vs Informal

Input: "翻译成韩语(敬语):谢谢你"

Output: 감사합니다 (formal)

Example 7: Multiple Languages at Once

Input: "'Hello' in all languages"

Output:

  • 中文:你好
  • English:Hello
  • 日文:こんにちは
  • 韩文:안녕하세요
  • 法文:Bonjour
  • 德文:Hallo
  • 等等...

Scripts

scripts/translate.py

Features:

  • Single and batch translation
  • Auto language detection
  • Multiple API support
  • Progress indicator for batch
  • Rich error handling

Usage:

# Single
python scripts/translate.py --text "Hello" --target zh

# Batch
python scripts/translate.py --batch --file input.txt --target ja

# With source language
python scripts/translate.py --text "Bonjour" --source fr --target en

Quality Assurance

Translation Accuracy

  • High - For major languages (zh, en, ja, ko, ru, ar, fr, de, es)
  • Medium - For other supported languages
  • Fallback available - AI translation ensures results

Best Practices

  1. Be specific about target language
    • ✓ "翻译成英文"
    • ✗ "翻译成外语"
  1. Use clear formatting for batch
    • ✓ "翻译成日文:\n苹果\n香蕉"
    • ✗ "翻译成日文:苹果香蕉"
  1. Specify source for ambiguous phrases
    • ✓ "Bonjour 翻译成中文" (specifying French)
    • ✓ "翻译:Bonjour to Chinese" (specifying source)

Notes

  • No API key required for AI-based translation
  • Batch translation for 2+ items supported
  • Auto-detection works for major languages
  • Results are cached for similar requests

Version History

  • v1.1 (current): Added batch translation, 15+ languages, error recovery, auto-detection
  • v1.0: Initial release with 6 languages

版本历史

共 1 个版本

  • v1.0.0 Initial release 当前
    2026-05-17 17:40 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

knowledge-management

常见语言翻译

user_d39ac014
Translate text between Chinese, English, Japanese, Korean, Russian, and Arabic. Use when user requests translation, need
★ 0 📥 115
office-efficiency

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 930 📥 187,078
office-efficiency

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 383 📥 145,777