微算力 · API 导航与自营网关
API 接入 EN
未登录登录
✨

Translator Pro

Translator Pro · v3.0.2
安全 S 级 作者 xueyetianya 公开目录收录
2.4k 下载 0 安装 6.1k 收藏 1 浏览

简介

Translator Pro

原始描述

Test translation quality with built-in dictionaries and comparison tools. Use when evaluating translations. Supports bilingual documentation and optimized AI...

通过你的 Agent 添加

安装目录:translator-pro/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/translator-pro/
Codex CLI~/.codex/skills/translator-pro/
DeepSeek Harness~/.agents/skills/translator-pro/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

translator-pro 是一套基于 Bash 的多语言翻译与本地化工具包,专为开发者和内容创作者设计。核心功能分为四大模块:语言检测(detect)通过 Unicode 范围启发式算法识别中日韩等六种语言;i18n 工具链(i18n-init/extract/check)提供项目国际化脚手架搭建、源代码翻译字符串提取及翻译覆盖率检查;个人词典管理(lookup/add/dict)支持本地 TSV 格式词条的增删查改;文本工具(romanize/count/glossary)提供占位符式罗马化转换、字符统计及领域术语表查询。

使用方式上,用户通过统一的 scripts/script.sh <command> 接口调用各功能。数据默认存储于 ~/.local/share/translator-pro/ 目录,包括个人词典和命令历史日志。translate 命令目前仅提供配置指导,实际翻译需配合外部 API 或词典查询完成。

显著优点

该 Skill 最大优势在于零外部依赖与纯本地运行——仅依赖系统自带的 bash 4.0+ 和 python3,无第三方库引入,彻底规避供应链攻击风险。代码风格严谨,启用 set -euo pipefail 安全选项,文件操作严格限定在用户数据目录。架构设计上采用模块化命令模式,各功能独立清晰,便于按需调用。i18n 工具链对前端开发者尤为实用,可快速初始化多语言项目结构并监控翻译进度。个人词典的 TSV 格式选择兼顾可读性与跨平台兼容,支持版本控制和手工编辑。

潜在缺点与局限性

功能完成度不足是最突出问题:batch/compare/i18n-merge/diff 四个命令均为 stub 状态,仅输出 TODO 占位符,与文档描述存在落差。romanize 采用字符类别占位符而非真实拼音/罗马字转换,实用性受限。translate 命令未实现实际翻译能力,需用户自行配置外部 API。输入验证方面,文件路径处理未做规范化检查,存在潜在路径遍历风险。此外,术语表(glossary)为硬编码的有限领域数据,扩展性较弱。

适合的目标群体

该工具最适合前端开发者进行 i18n 项目初始化与管理,技术写作者处理多语言文档的词汇一致性维护,以及注重隐私的用户——纯本地处理避免敏感文本上传云端。对于需要完整机器翻译能力的场景,建议配合外部 API 使用;对于个人知识管理,本地词典功能足以支撑轻量需求。

使用风险

性能层面:大量文本的批量处理效率受限于 Bash/Python 进程调用开销,不适合 GB 级数据处理。依赖风险:detect/romanize 依赖 Python 3 环境,在精简系统上可能不可用。功能误导:stub 命令可能让用户误以为是实现故障而非功能未开发,建议在 help 中明确标注。数据安全:虽然文件操作限定用户目录,但共享机器上的权限配置不当可能导致数据暴露。

技能正文


version: "3.0.2" name: translator-pro description: "Translate across CN/EN/JP/KR with glossary and batch mode. Use when translating docs, detecting language, batching jobs, comparing versions." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills

translator-pro

Multi-language translation and localization toolkit. Provides personal dictionary management, language detection via Unicode heuristics, i18n project scaffolding, and text analysis tools.

Commands

Translation

translate

Displays a translation info panel showing source/target languages and input text. Does not perform actual translation — prints guidance on setting TRANSLATE_API_KEY for API-based translation, or using lookup for personal dictionary entries.

scripts/script.sh translate "hello" en zh
scripts/script.sh translate "你好" auto en

detect

Detects the language of input text using Python-based Unicode range heuristics. Identifies Chinese, Korean, Japanese, Russian, Arabic, and Latin/English with a confidence percentage.

scripts/script.sh detect "你好世界"
scripts/script.sh detect "こんにちは"

batch

Stub — prints "TODO: batch translate". Not yet implemented.

scripts/script.sh batch input.txt en zh

compare

Stub — prints "TODO: compare". Not yet implemented.

scripts/script.sh compare "hello" en zh

Localization (i18n)

i18n-init

Creates an i18n directory structure for a project. Generates locales/<lang>/messages.json (empty JSON object) for each specified language. Defaults to en,zh,ja,ko if no languages are given.

scripts/script.sh i18n-init myproject en,zh,ja
scripts/script.sh i18n-init webapp en,fr,de,es

i18n-extract

Scans a source file for translatable strings matching patterns like __("..."), t("..."), or i18n("...") using grep, and prints each match with a total count.

scripts/script.sh i18n-extract src/app.js

i18n-check

Checks translation coverage by counting JSON keys in each messages.json file under a locales directory. Uses Python to parse JSON files.

scripts/script.sh i18n-check myproject/locales

i18n-merge

Stub — prints "TODO: merge". Not yet implemented.

scripts/script.sh i18n-merge base.json new.json

Dictionary

lookup

Searches the personal dictionary file (personal.tsv) for a word using case-insensitive grep. Prints matching entries as word → translation.

scripts/script.sh lookup hello
scripts/script.sh lookup 你好

add

Appends a word and its translation as a tab-separated line to the personal dictionary file (personal.tsv).

scripts/script.sh add hello 你好
scripts/script.sh add database 数据库

dict

Manages the personal dictionary. Takes a subcommand: list prints all entries with line numbers; export outputs entries as CSV with a word,translation header.

scripts/script.sh dict list
scripts/script.sh dict export

Text Tools

romanize

Replaces CJK characters with [CJK], hiragana with [hiragana], and katakana with [katakana] placeholders using Python. ASCII characters pass through unchanged. This is a placeholder-based conversion, not a true pinyin/romaji transliterator.

scripts/script.sh romanize "你好世界"
scripts/script.sh romanize "こんにちは"

count

Counts characters, words, and bytes in the input text using shell builtins and wc.

scripts/script.sh count "hello world"
scripts/script.sh count "你好世界"

diff

Stub — prints "TODO: diff". Not yet implemented.

scripts/script.sh diff file1.json file2.json

glossary

Prints a hardcoded multilingual glossary (Chinese + Japanese translations) for a given domain. Supported domains: tech, business. Any other input lists available domains.

scripts/script.sh glossary tech
scripts/script.sh glossary business

Utility

help

Prints usage information listing all commands and their arguments.

scripts/script.sh help

version

Prints the current version number.

scripts/script.sh version

Configuration

Variable Required Description
TRANSLATOR_DIR No Base data directory (default: ~/.local/share/translator-pro)
TRANSLATE_API_KEY No API key for online translation services (referenced in translate output but not used by the script)

Data Storage

All data is stored under ${TRANSLATOR_DIR:-~/.local/share/translator-pro}/:

  • dictionaries/personal.tsv — personal dictionary (tab-separated word/translation pairs)
  • history.log — command usage log with timestamps

Requirements

  • bash 4.0+
  • python3 (used by detect, i18n-check, and romanize)

Powered by BytesAgain | bytesagain.com | hello@bytesagain.com

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

没有标签

同类 Skill