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:
Parse the user's request to identify:
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 languageOutput 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):
GOOGLE_APPLICATION_CREDENTIALS for Google CloudDEEPL_API_KEY for DeepLAZURE_TRANSLATOR_KEY for Azurescripts/translate.py with your API key```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:
User: "翻译成日文:
今天天气很好
我们出去玩吧"
Process:
```
今日は天気がとても良いです
私たちは遊びに出かけましょう
```
User: "Translate this to English: Bonjour le monde"
Process:
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
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 APIdeepl - DeepL APIazure - Microsoft Azure Translatorlibre - 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.
共 1 个版本