闲社服务运行正常AI智能体自动化平台
x

智能翻译工具

技能标识:xtranslate

# Xtranslate 智能翻译工具 / Intelligent Translation Tool

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 3.2.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

智能翻译工具

Xtranslate 智能翻译工具 / Intelligent Translation Tool

OpenClaw调用方式 / OpenClaw Invocation Method

当用户在OpenClaw中提出以下需求时,调用本技能:
When users request the following in OpenClaw, invoke this skill:

用户指令 / User Commands执行动作 / Execution Actions
翻译文档 / 翻译文件 / 翻译PDF/Word<br>Translate document / Translate file / Translate PDF/Word调用程序自动翻译指定文件<br>Invoke program to automatically translate specified file
批量翻译 / 翻译文件夹<br>Batch translation / Translate folder
批量处理文件夹内所有支持格式的文件
Batch process all supported format files in folder |

调用示例 / Invocation Examples

用户说 / User says:帮我翻译这个PDF文件
Help me translate this PDF file

Claude执行 / Claude executes:
bash
python src/main.py --file document.pdf --engine cloud

用户说 / User says:批量翻译这个文件夹
Batch translate this folder

Claude执行 / Claude executes:
bash
python src/main.py --dir ./documents --engine cloud --model DeepSeek (V3/R1)

核心指令 / Core Commands

当用户需要翻译文档时,执行以下流程:
When users need to translate documents, execute the following process:

  1. 1. 配置翻译引擎 → 云端模型 / Ollama本地 / Python内置
    Configure translation engine → Cloud model / Ollama local / Python built-in
  2. 指定文件 → 支持PDF/DOCX/XLSX/PPTX/TXT/RTF等格式
    Specify file → Support PDF/DOCX/XLSX/PPTX/TXT/RTF and other formats
  3. 执行翻译 → 程序自动提取文本、翻译、保留格式、优化排版
    Execute translation → Program automatically extracts text, translates, preserves format, optimizes layout
  4. 输出结果 → 生成翻译后的文件到指定目录
    Output results → Generate translated files to specified directory

快速使用 / Quick Start

bash

翻译单个文件 / Translate single file


python src/main.py --file document.pdf --engine cloud

批量翻译文件夹 / Batch translate folder

python src/main.py --dir ./documents --output ./translated

指定模型和语言方向 / Specify model and language direction

python src/main.py --file doc.docx --model GPT-4o --sl en --tl zh-CN

使用Ollama本地模型 / Use Ollama local model

python src/main.py --file doc.pdf --engine ollama

配置说明 / Configuration Guide

环境变量配置 / Environment Variable Configuration

bash

DeepSeek API密钥 / API Key

$env:DEEPSEEKAPIKEY=your-api-key-here

OpenAI API密钥 / API Key

$env:OPENAIAPIKEY=your-api-key-here

Anthropic API密钥 / API Key

$env:ANTHROPICAPIKEY=your-api-key-here

SiliconFlow API密钥 / API Key

$env:SILICONFLOWAPIKEY=your-api-key-here

支持的翻译引擎 / Supported Translation Engines

引擎 / Engine说明 / Description适用场景 / Use Cases
cloud云端大模型(DeepSeek/GPT-4o/Claude等)<br>Cloud large models (DeepSeek/GPT-4o/Claude, etc.)高质量翻译,推荐<br>High-quality translation, recommended
ollama
本地Ollama模型
Local Ollama model | 隐私保护,离线使用
Privacy protection, offline use | | python | 内置translate库
Built-in translate library | 紧急备用,质量一般
Emergency backup, average quality |

支持的云端模型 / Supported Cloud Models

  • - DeepSeek (V3/R1)
  • GPT-4o
  • Claude 3.5 Sonnet
  • SiliconFlow (Qwen2.5)
  • 自定义 (OpenAI兼容接口)
    Custom (OpenAI compatible interface)

性能优化配置 / Performance Optimization Configuration

  • - 智能批次优化: 自动调整批次大小以平衡速度和质量
    Smart Batch Optimization: Automatically adjust batch size to balance speed and quality
  • 并发处理: 支持多批次并行翻译(可配置)
    Concurrent Processing: Support multi-batch parallel translation (configurable)
  • 参数调优: temperature=0.3 平衡准确性和创造性
    Parameter Tuning: temperature=0.3 balances accuracy and creativity
  • 大文档优化: 针对90页以上文档的特殊优化配置
    Large Document Optimization: Special optimization configuration for documents over 90 pages

输出结构 / Output Structure

output/ # 输出文件夹(自动创建)
# Output folder (automatically created)
├── translated_原文件名.docx # 翻译后的Word文档
# Translated Word document
├── translated_原文件名.pdf # 翻译后的PDF(通过Word转换)
# Translated PDF (converted from Word)
├── translated_原文件名.xlsx # 翻译后的Excel
# Translated Excel
├── translated_原文件名.pptx # 翻译后的PPT
# Translated PPT
tmp/ # 临时文件夹
# Temporary folder
└── [PDF转Word临时文件] # 自动清理
# [PDF to Word temporary files] # Auto cleanup

文件说明 / File Description

  • - 自动排版 - Word文档自动设置宋体/Times New Roman字体,1.25倍行距
    Automatic Layout - Word documents automatically set SimSun/Times New Roman font, 1.25 line spacing
  • 格式保留 - 保留原文档的表格、段落、样式等格式
    Format Preservation - Preserve tables, paragraphs, styles and other formats of original documents
  • 关键词引导 - 自动提取文档关键词,提升专业术语翻译准确性
    Keyword Guidance - Automatically extract document keywords to improve professional term translation accuracy

功能特点 / Features

  • - ✅ 多格式支持 - PDF/DOCX/XLSX/PPTX/TXT/RTF/WPS
    Multi-format Support - PDF/DOCX/XLSX/PPTX/TXT/RTF/WPS
  • ✅ 格式保留 - 翻译后保留原文档结构和样式
    Format Preservation - Preserve original document structure and style after translation
  • ✅ 智能排版 - 自动优化Word字体和行距
    Smart Layout - Automatically optimize Word fonts and line spacing
  • ✅ 批量处理 - 支持文件夹批量翻译
    Batch Processing - Support folder batch translation
  • ✅ 多引擎支持 - 云端/本地/内置三种引擎可选
    Multi-engine Support - Three engines available: cloud/local/built-in
  • ✅ 关键词提取 - 使用jieba提取专业术语提升翻译质量
    Keyword Extraction - Use jieba to extract professional terms to improve translation quality
  • - ✅ API加密 - API Key加密存储,确保安全
    API Encryption - Encrypt API Key storage to ensure security
  • ✅ 智能监控 - 全程记录翻译过程,自动性能分析
    Smart Monitoring - Record translation process throughout, automatic performance analysis
  • ✅ 自动优化 - 基于历史数据提供优化建议
    Auto Optimization - Provide optimization suggestions based on historical data
  • ✅ JSON批量 - 云模型采用JSON格式批量翻译,提升效率
    JSON Batch - Cloud model uses JSON format for batch translation, improving efficiency
  • ✅ 性能优化 - 智能批次调整,大文档处理速度提升25-30%
    Performance Optimization - Smart batch adjustment, large document processing speed improved by 25-30%
  • ✅ 并发加速 - 支持多批次并行处理,进一步提升效率
    Concurrent Acceleration - Support multi-batch parallel processing, further improve efficiency

文件结构 / File Structure

Xtranslate/
├── SKILL.md # 核心指令 + 元数据
# Core instructions + metadata
├── requirements.txt # Python依赖列表
# Python dependency list
├── Xtranslate.spec # PyInstaller打包配置
# PyInstaller packaging configuration
│
├── src/ # 源代码目录
# Source code directory
│ ├── config.py # 全局配置(引擎、模型、语言等)
# Global configuration (engines, models, languages, etc.)
│ ├── main.py # 命令行入口程序
# Command line entry program
│ ├── translator.py # 翻译引擎模块
# Translation engine module
│ ├── file_handler.py # 文件读写处理器
# File read/write processor
│ ├── analyzer

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 xtranslate-1776070092 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 xtranslate-1776070092 技能

通过命令行安装

skillhub install xtranslate-1776070092

下载

⬇ 下载 xtranslate v3.2.0(免费)

文件大小: 44.17 KB | 发布时间: 2026-4-15 15:05

v3.2.0 最新 2026-4-15 15:05
xtranslate 3.2 introduces a comprehensive, intelligent translation tool for multi-format documents.

- Added support for translating PDF, Word, Excel, PPT, TXT, and RTF files, with original formatting preserved and automatic layout optimization.
- Integrated multiple translation engines: cloud (DeepSeek, GPT-4o, Claude, etc.), Ollama local, and a built-in Python library for flexibility and security.
- Introduced batch folder translation, smart monitoring, and performance optimization (including concurrent processing and special handling for large documents).
- Implemented keyword extraction to improve translation accuracy of professional terms.
- Enhanced output structure to generate translated documents in multiple formats with automatic cleanup and encrypted API key storage.
返回顶部