常见语言翻译

👤 user_d39ac014 📦 v1.0.0 ⭐ 4.3 ⬇️ 562 下载
📄 办公效率 免费

📖 技能介绍


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."


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+)

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 हिन्दी

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

推荐访问7w4.net获取更多AI技能。

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
  2. ✓ "翻译成英文"
  3. ✗ "翻译成外语"

  4. Use clear formatting for batch

  5. ✓ "翻译成日文:\n苹果\n香蕉"
  6. ✗ "翻译成日文:苹果香蕉"

  7. Specify source for ambiguous phrases

  8. ✓ "Bonjour 翻译成中文" (specifying French)
  9. ✓ "翻译: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

🤖 AI 评测

这个翻译 Skill 功能较全面,支持多语言和批量处理,文档和示例清晰易懂,质量中上。优点是使用灵活、错误处理较好;不足在于实际翻译效果依赖 AI 而非专用翻译引擎,准确性可能不稳定,且部分功能描述与实现存在偏差。日常简单翻译需求可以尝试,但对翻译质量要求较高的场景可能不太满足。

📊 多维度评分

适应性4.4
规范性4
有效性4.6
可靠性3.8
可信度4.5

📁 包含文件 (2 个)

📄 SKILL.md 6.7 KB
📄 scripts/translate.py 7.6 KB