跳转到内容
Agentic Workflowdocs
v0.8.2免费安装

节点 / builtin / ai / localai

Translate

Translate text between languages on-device

AI 扩展程序网页应用

此内容尚不支持你的语言。

Translate text between languages with a model that runs in your browser, so the text never leaves your device.

Translate splits the Text into pieces of about 1,000 characters at sentence ends, translates each piece with the model you pick, and joins the results.

  • With NLLB-200 distilled (translate), you choose the languages in From and To. It covers 200 languages.
  • With a fixed-pair model whose name ends in opus-mt-xx-yy (added as a custom model), the model always translates its own pair and ignores From and To.

When From and To are the same, the text is returned unchanged without running the model. There is no cost per run and no API key.

  • Translate incoming messages or scraped pages before you process them.
  • Translate a reply before you send it.

To translate with a chat model and your own instructions, use Basic LLM Chain.

设置项类型作用
Text Long textThe text to translate.
From ChoiceSource language. Ignored by fixed-pair opus-mt models. 59 options. 默认值:English
To ChoiceTarget language. Ignored by fixed-pair opus-mt models. 59 options. 默认值:French
Model Model pickerOnly translation models are listed here.

From and To list 59 common languages by name. With an expression you can also pass an English language name (Spanish), a two-letter code (es) or any NLLB-200 code (spa_Latn), which reaches all 200 languages. For example, set To to {{ $input.language }}.

  • Output

Each output item has these fields:

Field类型What it holds
text TextThe translated text
from Text
to Text
Shape of an output item
{
"text": "…",
"from": "…",
"to": "…"
}

from and to are the language codes actually used: NLLB codes such as eng_Latn and fra_Latn, or the model’s own pair (such as en and de) for an opus-mt model.

None. This node needs no connection and has no slots for other nodes.

The Model picker lists your installed translation models first, then ones that download on first use. NLLB-200 distilled (translate) is a large download (about 460 MB). To use an opus-mt model, add it on the Local AI page.

Translate the text you select into English:

  1. Context Menu with Menu Contexts set to Selection.
  2. Translate with Text {{ $input.selectionText }}, From French, To English and Model NLLB-200 distilled (translate).
  3. Show Notification with Title Translation and Message {{ $input.text }}.
  • “Choose a translation model.” Model is empty. Pick one.
  • “Provide some text to translate.” Text is empty after expressions run.
  • “Unknown source language “…”.“ or “Unknown target language “…”.“ An expression in From or To returned something that is not a listed name, a two-letter code or an NLLB code.
  • The output is in the wrong language. You picked an opus-mt model: it ignores From and To. Use NLLB-200 for other pairs.
  • The first run is slow. The model downloads and loads on first use; later runs are fast.
编辑此页

最近更新:

Was this page useful?
向 Aria 询问“Translate”