name: translator description: "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."
Professional translation skill supporting 15+ languages with advanced features:
| Language | Code | Native Name |
|---|---|---|
| Chinese (Simplified) | zh | 中文(简体) |
| Chinese (Traditional) | zh-TW | 中文(繁體) |
| English | en | English |
| Japanese | ja | 日本語 |
| Korean | ko | 한국어 |
| Russian | ru | Русский |
| Arabic | ar | العربية |
| French | fr | Français |
| German | de | Deutsch |
| Spanish | es | Español |
| Italian | it | Italiano |
| Portuguese | pt | Português |
| Thai | th | ไทย |
| Vietnamese | vi | Tiếng Việt |
| Hindi | hi | हिन्दी |
User: "把'你好世界'翻译成英文"
→ "Hello World"
User: "把以下内容翻译成日文:
苹果 - Apple
香蕉 - Banana
橙子 - Orange"
→ 苹果 - リンゴ
香蕉 - バナナ
オレンジ - オレンジ
User: "Translate: Bonjour le monde"
→ Auto-detect: French → "Hello World"
Trigger Keywords: - "翻译" / "translate" / "翻译成" / "translation" - "用XX语怎么说" / "How do you say X in XX" - "Language exchange" / "convert to XX"
Detection Patterns: - Explicit: "翻译成英文" - Implicit: "这段话用日语怎么说"
Priority: 1. Try API-based translation (if API key configured) 2. Fallback to Claude-based translation 3. Return formatted result
Output Formats:
Simple (default):
[translated text]
With Source:
原文(中文):你好世界
翻译(英文):Hello World
Detailed:
原文:你好世界
源语言:中文
目标语言:English
翻译结果:Hello World
翻译方式:AI-based (Claude)
For multiple texts, process efficiently:
Input: "翻译成韩文:
- 你好
- 谢谢
- 对不起"
Output:
- 你好 → 안녕하세요
-谢谢 → 고마워요
- 对不起 → 죄송합니다
Best practices for batch: - Use bullet points or numbered lists - Keep each item concise - Format consistently
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
If translation fails: 1. Try alternative translation method 2. Provide partial results if possible 3. Suggest fixes for configuration issues
Example error handling:
7w4.net小葱技能站收录全网优质技能,值得收藏。
原文:[text]
错误:Translation API unavailable
备选:Using AI translation
结果:[translated text]
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.
Input: "把'谢谢'翻译成英文" Output: "Thank you"
Input: "翻译成日文:今天天气很好" Output: 今日は天気がとても良いですね
Input: "翻译成韩文: 苹果 香蕉 橙子" Output: - 苹果 → 사과 -香蕉 → 바나나 - オレンジ → 오렌지
Input: "Translate: Guten Morgen to Chinese" Output: 早上好
Input: "用日语说'祝你生日快乐'" Output: お誕生日おめでとうございます
Input: "翻译成韩语(敬语):谢谢你" Output: 감사합니다 (formal)
Input: "'Hello' in all languages" Output: - 中文:你好 - English:Hello - 日文:こんにちは - 韩文:안녕하세요 - 法文:Bonjour - 德文:Hallo - 等等...
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
✗ "翻译成外语"
Use clear formatting for batch
✗ "翻译成日文:苹果香蕉"
Specify source for ambiguous phrases
这个翻译 Skill 功能较全面,支持多语言和批量处理,文档和示例清晰易懂,质量中上。优点是使用灵活、错误处理较好;不足在于实际翻译效果依赖 AI 而非专用翻译引擎,准确性可能不稳定,且部分功能描述与实现存在偏差。日常简单翻译需求可以尝试,但对翻译质量要求较高的场景可能不太满足。