app icon
file_translator
0.0.2

profile file to file translation service

xuyangyang/file_translator391 installs

File Translator Plugin

Translate common Office documents inside Dify while keeping layout, fonts, and basic styling intact.

Overview

FieldValue
Authorxuyangyang
Version0.0.1
Plugin TypeTool Provider
Supported UIApps, Workflows, Agents

The plugin wraps several file translators (TXT / DOCX / XLSX / PPTX). Each tool downloads the source file, streams text to an LLM in token-aware batches, then writes the translated content back to a copy of the original document.


Provided Tools

Tool YAMLPurpose
Line-preserving text file translation
Paragraph/run-preserving Word translation
Cell-preserving Excel translation
Shape/run-preserving PowerPoint translation

All tools expose the same parameter set; only the output format changes.


Features

  • Structure-aware rewriting keeps paragraphs, bullet points, and table cells aligned.
  • Automatic batching with retry and fallback ensures long documents are covered, even when a chunk exceeds the model’s token limit.
  • Uses whatever LLM configuration you supply through Dify (temperature, model name, max tokens, etc.).
  • Generates predictable filenames such as .

Installation

  1. Package the plugin:
  2. Upload the generated in Dify’s Plugin Management console.
  3. Enable the tools you need for your App/Workflow.

No extra environment variables or API keys are required beyond the LLM credentials already configured in Dify.


Usage

  1. In a workflow node (or tool call), select one of the translators.
  2. Supply the required parameters:
ParameterTypeRequiredNotes
stringYesDify-uploaded file URL or accessible HTTP(S) link.
stringYesUsed to infer extension and generate the output name.
objectYesFull LLM configuration object (e.g. from previous node or App settings).
stringNoDefaults to . Accepts language names or codes understood by the LLM.
intNoMax tokens per request (default 1800, clamped to 200–6000).
intNoOptional overlap for context continuity (default 60).
  1. Collect the response:
    • A binary blob message containing the translated document.
    • A text summary confirming completion.

Output

  • File MIME type matches the input format (, , , ).
  • Original filename is preserved with appended before the extension.
  • When the source has no translatable content, the original file is returned unchanged with an informational message.

Requirements

The plugin’s runtime depends on:

These are pulled automatically during packaging/execution.


Notes & Limitations

  • Excel support requires . Legacy files should be converted first.
  • Formatting is preserved at run/cell level; complex scripting, animations, or embedded objects are not modified.
  • If the LLM fails to translate a line after backoff retries, the original text is left in place to avoid data loss.
  • PPT translation now splits oversized chunks recursively so every slide receives an attempt even when token limits are tight.

Development

To run the plugin locally for debugging:

Ensure is configured with your Dify remote debugging credentials (see for details).


License

Distributed under the MIT License. See for full text.

CATEGORY
Tool
VERSION
0.0.2
xuyangyang·11/21/2025 02:08 PM
REQUIREMENTS
LLM invocation
Tool invocation
App invocation
Endpoint registration
Maximum memory
256MB
Maximum storage
1MB