name: translator description: Translate text between Chinese, English, Japanese, Korean, Russian, and Arabic. Use when user requests translation, needs text converted to another language, or mentions translation tasks. Supports both API-based translation (when configured) and AI-based translation as fallback. Trigger keywords include "翻譯", "translate", "翻譯成", "translation", or any request to convert text from one language to another.
This skill provides text translation services between six languages: Chinese (Simplified), English, Japanese, Korean, Russian, and Arabic. It supports two translation methods:
Basic translation workflow:
User: "把'你好世界'翻譯成英文"
→ Extract text: "你好世界"
→ Extract target language: "英文" (English)
→ Call translation script or use Claude
→ Return: "Hello World"
Detect when user wants translation by looking for: - Explicit triggers: "翻譯", "translate", "翻譯成", "translation" - Implicit requests: "這段話用日語怎麼說", "How do you say X in French" - Language mentions: "中文轉英文", "English to Japanese"
Parse the user's request to identify: - Source text: The text to be translated - Target language: The desired output language - Source language (optional): If specified, use it; otherwise auto-detect
Examples:
Input: "把'你好世界'翻譯成英文"
→ text: "你好世界"
→ target: "英文" (English)
→ source: (auto-detect = Chinese)
Input: "Translate 'Hello World' to Japanese"
→ text: "Hello World"
→ target: "Japanese"
→ source: (auto-detect = English)
Priority order:
scripts/translate.py with text, source, and target languageSee API Setup for configuration
Fallback to Claude translation (if API fails or not configured)
Output the translated text in a clear format:
原文(中文):你好世界
翻譯(英文):Hello World
| Language | Code | Native Name |
|---|---|---|
| Chinese (Simplified) | zh | 中文(簡體) |
| English | en | English |
| Japanese | ja | 日本語 |
| Korean | ko | 한국어 |
| Russian | ru | Русский |
| Arabic | ar | العربية |
To use API-based translation (higher quality, consistent results):
LibreTranslate (open-source, self-hosted)
Configure the script by setting environment variables:
GOOGLE_APPLICATION_CREDENTIALS for Google CloudDEEPL_API_KEY for DeepLAZURE_TRANSLATOR_KEY for AzureOr update scripts/translate.py with your API key
Test the setup by running:
bash
python scripts/translate.py --text "Hello" --target zh
If API is not configured or fails, the skill automatically falls back to Claude-based translation.
User: "把'謝謝'翻譯成英文"
Process: 1. Detect translation request 2. Extract: text="謝謝", target=English 3. Perform translation (API or Claude) 4. Return: "Thank you"
User: "翻譯成日文: 今天天氣很好 我們出去玩吧"
Process:
1. Extract full text (preserve line breaks)
2. Target language: Japanese
3. Translate preserving formatting
4. Return:
今日は天気がとても良いです
私たちは遊びに出かけましょう
User: "Translate this to English: Bonjour le monde"
Process: 1. Extract text: "Bonjour le monde" 2. Auto-detect source: French 3. Target: English 4. Return: "Hello World"
Python script that performs API-based translation. Supports multiple translation services and fallback to Claude.
Usage:
python scripts/translate.py --text "Hello World" --target zh --source en小蔥技能有更好的技能skills外掛。
Parameters:
- --text: Text to translate (required)
- --target: Target language code (required, e.g., zh, en, ja)
- --source: Source language code (optional, auto-detect if omitted)
- --api: API service to use (optional, default: auto-select)
Supported APIs:
- google - Google Cloud Translation API
- deepl - DeepL API
- azure - Microsoft Azure Translator
- libre - LibreTranslate (open-source)
translate.py script requires additional Python libraries depending on the API service chosen (e.g., google-cloud-translate, deepl, requests)No additional reference files needed. The skill is self-contained with the script and this SKILL.md.
No additional assets needed. Translation is performed via API or Claude directly.
這個翻譯工具質量不錯,支援常用語言互譯,文件說明詳細,容易上手。最大優點是配置靈活,API 不可用時還能用 AI 翻譯作為備選。不足之處是如果沒有配置 API,實際翻譯效果會打折扣,另外需要安裝額外的依賴庫才能使用。對於日常翻譯需求來說基本夠用,但配置過程對新手不太友好。