← 返回 Skills 市场
rockbenben

Deepl Translate Node

作者 rockbenben · GitHub ↗ · v1.1.1 · MIT-0
cross-platform ✓ 安全检测通过
33
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install deepl-translate-node
功能描述
Use DeepL's neural MT API as a fallback when you are NOT confident in your own translation — proper nouns, ambiguous phrasing, domain/legal/medical terminolo...
使用说明 (SKILL.md)

DeepL Translate (confidence-gated fallback)

A thin wrapper around the DeepL API. The point of this skill is the trigger logic, not the API call: translate with DeepL when your own translation might be wrong and being wrong matters.

When to reach for DeepL instead of translating yourself

Translate it yourself when the text is everyday prose and you are confident. Call DeepL when any of these is true:

  • Proper nouns / brand / product names that have official localized forms
  • Domain terminology — legal, medical, financial, technical specs, patents
  • Ambiguous source where one word maps to several target words and context doesn't disambiguate
  • Idioms / fixed expressions that don't translate literally
  • Low-resource or distant language pairs where your training signal is thin
  • High-stakes output — anything the user will publish, sign, or send to a third party, where a subtle error is costly
  • The user explicitly asks for DeepL.

If you're confident and the cost of a minor error is low, just translate directly — don't burn an API call.

Prerequisite: API key

The key is read from the DEEPL_API_KEY environment variable (never hardcode it). Default endpoint is the Free tier host api-free.deepl.com; for Pro, set DEEPL_API_HOST=api.deepl.com.

Set it once:

# macOS / Linux — add to ~/.bashrc or ~/.zshrc to persist
export DEEPL_API_KEY="your-deepl-auth-key-here"
# Windows (persistent, user scope) — then open a NEW shell
setx DEEPL_API_KEY "your-deepl-auth-key-here"

Verify in a fresh shell: echo $DEEPL_API_KEY (bash) / $env:DEEPL_API_KEY (PowerShell).

If DEEPL_API_KEY is unset, stop and tell the user to set it — do not invent a key.

How to call it

Use the bundled Node helper (cross-platform, Node 18+). --source is optional; omit it to let DeepL auto-detect.

Language codes (DeepL next-gen model — broad coverage)

DeepL supports far more than the classic ~30 languages. Don't assume a language is unsupported — check before falling back to a self-translation.

  • Core (source + target): AR BG CS DA DE EL EN ES ET FI FR HU ID IT JA KO LT LV NB NL PL PT RO RU SK SL SV TR UK ZH
  • Extended (~100 languages, incl. many low-resource ones): AF BN FA HE HI HR HY KA ML MR MS MY NE PA SW TA TE TH UR VI YUE ZU … and many more.
  • Target-only regional variants — prefer these when precision matters:
    • Chinese: ZH-HANS (Simplified), ZH-HANT (Traditional) — better than bare ZH
    • English: EN-US, EN-GB
    • Portuguese: PT-BR, PT-PT
    • Spanish: ES-419 (Latin American)
    • FR-CA (Canadian French, beta), DE-CH (Swiss German, beta) — beta = not billed

For the authoritative, always-current list, query the API. Use the v3 languages endpoint (recommended for new integrations; replaces /v2/languages). The resource query parameter is required — omitting it returns 400: GET https://api-free.deepl.com/v3/languages?resource=translate_text with the Authorization: DeepL-Auth-Key \x3Ckey> header. Valid resource values: translate_text, translate_document, voice, write, glossary, style_rules. It returns one entry per language (100+ for translate_text) with source/target support flags. Or see https://developers.deepl.com/docs/getting-started/supported-languages

Code-format caveat: /v3/languages returns BCP 47 codes (en-US, pt-BR, zh-Hant — lowercase base, uppercase region, title-case script). But the translation endpoint is still /v2/translate, whose target_lang accepts the v2-style UPPERCASE codes (EN-US, PT-BR, ZH-HANT). Don't mix the two casings when feeding a value from the languages endpoint into a translate call.

Versioning note: Only glossaries and the languages list have moved to v3. Text translation has no v3 endpoint/v2/translate is current and not deprecated.

node "{SKILL_DIR}/translate.mjs" --target ZH \
    --text "The plaintiff filed a motion to compel discovery."

With an explicit source language:

node "{SKILL_DIR}/translate.mjs" --source JA --target EN-US --text "持分会社"

The script prints only the translated text on success, or an error line (prefixed ERROR:) on failure. Multiple lines / paragraphs are preserved.

Workflow inside a task

  1. You're translating something and hit a passage you're unsure about.
  2. Confirm DEEPL_API_KEY is set (the script checks and errors clearly if not).
  3. Run translate.mjs for the uncertain passage (or the whole text).
  4. Use DeepL's output. If it conflicts with your own read, surface both to the user and explain the discrepancy rather than silently picking one.

Glossary / terminology consistency (optional)

For repeated terminology, pass --glossary as a term=translation;term=translation list and the script will post-process exact matches after DeepL returns. For real glossary support DeepL has a Glossary API; ask the user if they need it and we can extend the script.

Notes

  • Free tier: 500,000 chars/month. The script does not track quota; if you get a 456 response that means quota exhausted.
  • 403 means a bad/missing key.
  • For DeepL Pro, set DEEPL_API_HOST=api.deepl.com (default is api-free.deepl.com).
安全使用建议
Install only if you are comfortable sending text to DeepL for translation. Do not use it for secrets, confidential business material, or regulated legal/medical/financial content unless the user explicitly approves that external transfer, and keep DEEPL_API_HOST set only to DeepL’s documented hosts.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The skill’s purpose is translation through DeepL, and the bundled helper does exactly that by POSTing provided text to DeepL’s translate endpoint.
Instruction Scope
The instructions clearly gate use to uncertain or high-value translations, but they could be clearer that user text leaves the local environment and should not include secrets or regulated data without consent.
Install Mechanism
The artifact contains only SKILL.md and a Node helper script; it declares Node as the required binary and no package installation is requested.
Credentials
Using DEEPL_API_KEY is proportionate for DeepL access, and DEEPL_API_HOST is documented for Free versus Pro endpoints; users should avoid setting it to an untrusted host.
Persistence & Privilege
The skill suggests persisting DEEPL_API_KEY in shell configuration, which is expected for an API integration but should be treated as a sensitive local credential.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install deepl-translate-node
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /deepl-translate-node 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.1
- Bump version to 1.1.1. - Documentation updates only; no functional changes to code.
v1.1.0
- Expanded documentation on when and why to use DeepL as a fallback for translations, emphasizing proper nouns, ambiguous phrasing, domain-specific terminology, idioms, low-resource languages, and high-stakes cases. - Updated DeepL language support details, including instructions for querying the new v3 languages endpoint and BCP 47 code handling. - Clarified use of the DeepL API (with environment variable setup for `DEEPL_API_KEY` and `DEEPL_API_HOST`) and workflow steps for robust integration. - Added guidance on glossary usage and terminology consistency. - Included detailed usage examples and troubleshooting information about quota limits and authentication errors.
元数据
Slug deepl-translate-node
版本 1.1.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Deepl Translate Node 是什么?

Use DeepL's neural MT API as a fallback when you are NOT confident in your own translation — proper nouns, ambiguous phrasing, domain/legal/medical terminolo... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 33 次。

如何安装 Deepl Translate Node?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install deepl-translate-node」即可一键安装,无需额外配置。

Deepl Translate Node 是免费的吗?

是的,Deepl Translate Node 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Deepl Translate Node 支持哪些平台?

Deepl Translate Node 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Deepl Translate Node?

由 rockbenben(@rockbenben)开发并维护,当前版本 v1.1.1。

💬 留言讨论