← 返回
未分类

常见语言翻译

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.
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.
user_d39ac014
未分类 community v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 84
下载
💾 0
安装
1
版本
#latest

概述

Translator

Overview

This skill provides text translation services between six languages: Chinese (Simplified), English, Japanese, Korean, Russian, and Arabic. It supports two translation methods:

  1. API-based translation (primary) - Uses external translation APIs for high-quality translation
  2. AI-based translation (fallback) - Uses Claude's built-in translation capabilities when API is unavailable

Quick Start

Basic translation workflow:

User: "把'你好世界'翻译成英文"
→ Extract text: "你好世界"
→ Extract target language: "英文" (English)
→ Call translation script or use Claude
→ Return: "Hello World"

Core Workflow

Step 1: Identify Translation Request

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"

Step 2: Extract Text and Target Language

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)

Step 3: Perform Translation

Priority order:

  1. Try API translation first (if configured)
    • Run scripts/translate.py with text, source, and target language
    • See API Setup for configuration
  1. Fallback to Claude translation (if API fails or not configured)
    • Use Claude's built-in translation capability
    • Provide accurate translation directly

Step 4: Return Translated Text

Output the translated text in a clear format:

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

Supported Languages

LanguageCodeNative Name
-----------------------------
Chinese (Simplified)zh中文(简体)
EnglishenEnglish
Japaneseja日本語
Koreanko한국어
RussianruРусский
Arabicarالعربية

API Setup

To use API-based translation (higher quality, consistent results):

  1. Get API credentials for one of these services:
    • Google Cloud Translation API
    • DeepL API
    • Microsoft Azure Translator
    • LibreTranslate (open-source, self-hosted)
  1. Configure the script by setting environment variables:
    • GOOGLE_APPLICATION_CREDENTIALS for Google Cloud
    • DEEPL_API_KEY for DeepL
    • AZURE_TRANSLATOR_KEY for Azure
    • Or update scripts/translate.py with your API key
  1. 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.

Usage Examples

Example 1: Simple Translation

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

Process:

  1. Detect translation request
  2. Extract: text="谢谢", target=English
  3. Perform translation (API or Claude)
  4. Return: "Thank you"

Example 2: Multi-line Text

User: "翻译成日文:

今天天气很好

我们出去玩吧"

Process:

  1. Extract full text (preserve line breaks)
  2. Target language: Japanese
  3. Translate preserving formatting
  4. Return:

```

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

私たちは遊びに出かけましょう

```

Example 3: Auto-detect Source Language

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"

Scripts

scripts/translate.py

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 API
  • deepl - DeepL API
  • azure - Microsoft Azure Translator
  • libre - LibreTranslate (open-source)

Notes

  • This skill prioritizes simplicity and ease of use
  • For advanced features (batch translation, document translation, preservation of formatting), consider extending this skill with additional scripts
  • The translate.py script requires additional Python libraries depending on the API service chosen (e.g., google-cloud-translate, deepl, requests)
  • If no API is configured, Claude's built-in translation capability provides a reliable fallback

References

No additional reference files needed. The skill is self-contained with the script and this SKILL.md.

Assets

No additional assets needed. Translation is performed via API or Claude directly.

版本历史

共 1 个版本

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

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

knowledge-management

web-tools-guide

user_ec205dbb
MANDATORY before calling web_search, web_fetch, browser, or opencli. Contains required error-handling procedures (web_se
★ 71 📥 161,410
knowledge-management

Obsidian

steipete
操作 Obsidian 仓库(纯 Markdown 笔记)并通过 obsidian-cli 自动化。
★ 446 📥 105,029
office-efficiency

常见语言翻译

user_d39ac014
Translate text between 15+ languages with high accuracy. Supports single/batch translation, automatic language detection
★ 0 📥 163