DeepL
This component acts as a bridge to the DeepL Translation API (v2), allowing you to translate text with human-like quality in over 31 languages. It is designed to be easy to use within your Nappai workflows, whether you need to translate a single phrase or process a list of items. It also offers features to adjust the tone of the language (formal vs. informal) and check your account usage statistics.
How it Works
This component connects securely to DeepL’s external servers to perform translation. It uses advanced Neural Machine Translation (NMT) technology, which means it doesn’t just swap words; it understands context, grammar, and tone to produce natural-sounding results.
When you send text to this component, it:
- Authenticates your account using the credentials you provided.
- Translates the text from the source language to the target language.
- Formats the result based on your settings (e.g., keeping HTML tags intact or adjusting formality).
- Returns the translated text along with any relevant metadata, such as the detected source language or usage statistics.
Connection & Credentials
This component requires configuring a credential in the Nappai panel before interacting with the external service:
- Go to the Credentials section in your Nappai panel.
- Create a new credential of the type DeepL Translate and fill in the required field: DeepL Auth Key (your API password).
- In your workflow, select the saved credential in the Credential input field of this node.
Inputs
Mapping Mode
This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:
- Fixed: You type the value directly into the field.
- Mapped: You connect the output of another component to use its result as the value.
- Javascript: You write Javascript code to dynamically calculate the value.
This flexibility allows you to create more dynamic and connected workflows.
Input Fields
The following fields are available to configure this component. Each field may be visible in different operations:
- Operation: Select the DeepL operation to perform.
- Text: The text to translate.
- Source Language: Source language code (e.g., ‘EN’, ‘ES’, ‘FR’). Leave empty for auto-detection.
- Target Language: Target language code (e.g., ‘EN-US’, ‘ES’, ‘FR’, ‘DE’, ‘JA’, ‘ZH’).
- Formality: Sets whether translations should lean toward formal or informal language. Supported for some target languages.
Outputs
Output Data Example (JSON)
The component returns a structured result that you can pass to other components in your workflow. json { “data”: { “translations”: [ { “text”: “Hello, how are you?”, “detected_source_language”: “EN”, “formality”: “default” } ], “usage”: { “characters”: { “free”: 0, “premium”: 100 } } } }
Note: The data output contains the translated text and metadata. You can map this data field to other components that expect translated content.
Connectivity
This component is typically used in workflows that involve content localization, communication, or data processing.
Typical Connections:
- From: Text components (e.g., Email Extractor, Web Scrapers, Document Processors). These components generate raw text that needs translation.
- To: Text Display components, Email Senders, Database Storage components, or LLM prompts. These components need the translated text to perform their actions.
Why it makes sense: Because DeepL provides high-quality translations, this component is ideal for preparing content for international audiences. For example, you might translate customer support emails into multiple languages before sending them, or translate product descriptions for a global website.
Usage Example
Imagine you are building a workflow for a multinational customer support team.
- Input: You receive an email from a customer in Spanish.
- Process: You use the DeepL component to translate the email body from Spanish (
ES) to English (EN). - Result: The component outputs the English translation.
- Next Step: You can now use an LLM component to summarize the translated text or save the original and translated versions into a database for record-keeping.
Tips and Best Practices
- Auto-Detection: If you are unsure of the source language, leave the Source Language field empty. DeepL will automatically detect it, which is useful for handling mixed-language inputs.
- Formality Matters: If you are translating business communications, try setting the Formality to “more_formal” to ensure the tone is professional. For casual chat, use “less_formal” or “default”.
- Use Mapping Mode for Bulk Tasks: If you need to translate a list of product names or database entries, enable Mapping Mode. This allows you to translate multiple items efficiently in one go.
- Check Your Credits: If you are using a free API key, keep an eye on your usage. The component can help you track character counts to avoid exceeding your free tier limits.
Security Considerations
- API Key Protection: Never share your DeepL Auth Key. Always use the Nappai Credentials system to store it securely. The component handles the key safely, so you do not need to manage API keys manually in your workflow steps.
- Data Privacy: Ensure that the text you send to DeepL complies with your organization’s data privacy policies. While DeepL is a reputable service, sensitive personal information should be handled according to GDPR or local regulations.