星期日 , 8 11 月 2026

为什么ds+n8n翻译只能保存一种语言解答

Looking at your workflow, I can identify the exact problem and provide a solution.

The Problem

The issue is in your “Set Language Config” node where you define:

javascript

target_languages: "zh"  // Single string, not an array

Even though you later split this with “Split Target Languages” node, you’re only providing ONE language (“zh”). The split operation has nothing to split since it’s a single value.

The Root Cause

Your workflow architecture is actually designed correctly to handle multiple languages – it has the “Split Target Languages” node that should iterate through each target language. However, you’re only feeding it one language.

The Solution

Option 1: Quick Fix – Modify the Set Language Config Node

Change the “Set Language Config” node to use an array:

javascript

{
  "fields": {
    "values": [
      {
        "name": "target_languages",
        "stringValue": '["zh", "fr", "ja", "de"]'  // JSON array as string
      },
      {
        "name": "source_lang",
        "stringValue": "en"
      }
    ]
  }
}

But wait – n8n’s Set node uses stringValue, so you need to handle this properly.

Option 2: Better Approach – Use Code Node Instead

Replace the “Set Language Config” node with a Code node:

javascript

return [
  {
    json: {
      post_types: $input.first().json.post_types,
      target_languages: ["zh", "fr", "ja", "de"], // Array of languages
      source_lang: "en"
    }
  }
];

Option 3: Most Flexible – Use Set Node Correctly

In the “Set Language Config” node, change the field type:

  1. Click on the node
  2. For target_languages, instead of using “String”, choose “Expression”
  3. Enter: ["zh", "fr", "ja", "de"]

This will create a proper array that the “Split Target Languages” node can iterate over.

Updated Workflow Section

Here’s how your updated nodes should look:

Fixed Language Config Node (Code Version)

Code 

// Replace “Set Language Config” node with this Code node // This properly sets up multiple target languages const inputData = $input.first().json; return [ { json: { post_types: inputData.post_types, // Add all your target langua

Why This Works

Your workflow has this flow:

  1. Get All Post Types → Returns post types
  2. Set Language Config → Should set target_languages as array
  3. Split Post Types → Iterates each post type
  4. Split Target Languages → Iterates each target language (THIS was getting only 1 item)
  5. Get Untranslated Posts → Gets posts for current post_type + target_lang combination

The “Split Target Languages” node was working correctly, but it was only receiving a single string "zh" instead of an array ["zh", "fr", "ja"], so it only processed one language.

const inputData = $input.first().json; return [ { json: { post_types: inputData.post_types, // Add all your target languages here target_languages: [“zh”, “fr”, “ja”, “de”, “es”, “pt”], source_lang: “en” } } ];

×
为什么ds+n8n翻译只能保存一种语言解答

为什么ds+n8n翻译只能保存一种语言解答

Looking at your work...

查看更多

AI agent 如何翻译网站(标签+动态内容)

先让AI把网站进行i18n化, …