Files
n8n-enterprise-unlocked/packages/frontend/@n8n/i18n/docs/ADDENDUM.md

3.4 KiB

Addendum for i18n in n8n

Base text

Pluralization

Certain base text strings accept singular and plural versions separated by a | character:

{
	"tagsView.inUse": "{count} workflow | {count} workflows"
}

Interpolation

Certain base text strings use interpolation to allow for a variable between curly braces:

{
	"stopExecution.message": "The execution with the ID {activeExecutionId} got stopped!",
	"stopExecution.title": "Execution stopped"
}

When translating a string containing an interpolated variable, leave the variable untranslated:

{
	"stopExecution.message": "Die Ausführung mit der ID {activeExecutionId} wurde gestoppt",
	"stopExecution.title": "Execution stopped"
}

Reusable base text

As a convenience, the base text file may contain the special key _reusableBaseText, which defines strings that can be shared among other strings with the syntax @:_reusableBaseText.key, as follows:

{
	"_reusableBaseText.save": "🇩🇪 Save",
	"duplicateWorkflowDialog.enterWorkflowName": "🇩🇪 Enter workflow name",
	"duplicateWorkflowDialog.save": "@:_reusableBaseText.save",
	"saveButton.save": "@:_reusableBaseText.save",
	"saveButton.saving": "🇩🇪 Saving",
	"saveButton.saved": "🇩🇪 Saved"
}

For more information, refer to Vue i18n's linked locale messages.

Nodes in versioned dirs

For nodes in versioned dirs, place the /translations dir for the node translation file alongside the versioned *.node.ts file:

Mattermost
  └── Mattermost.node.ts
    └── v1
        ├── MattermostV1.node.ts
        ├── actions
        ├── methods
        ├── transport
        └── translations
            └── de
                └── mattermost.json

Nodes in grouping dirs

For nodes in grouping dirs, e.g. Google nodes, place the /translations dir for the node translation file alongside the *.node.ts file:

Google
  ├── Books
  ├── Calendar
  └── Drive
      ├── GoogleDrive.node.ts
      └── translations
          └── de
              ├── googleDrive.json
              └── googleDriveTrigger.json

Dynamic text

Reusable dynamic text

The base text file may contain the special key reusableDynamicText, allowing for a node parameter to be translated once and reused in all other node parameter translations.

Currently only the keys oauth.clientId and oauth.clientSecret are supported as a PoC - these two translations will be reused in all node credential parameters.

{
	"_reusableDynamicText.oauth2.clientId": "🇩🇪 Client ID",
	"_reusableDynamicText.oauth2.clientSecret": "🇩🇪 Client Secret"
}

Special cases

eventTriggerDescription and activationMessage are dynamic node properties that are not part of node parameters. To translate them, set the key at the root level of the nodeView property in the node translation file.

Webhook node:

{
	"nodeView.eventTriggerDescription": "🇩🇪 Waiting for you to call the Test URL"
}

Cron node:

{
	"nodeView.activationMessage": "🇩🇪 'Your cron trigger will now trigger executions on the schedule you have defined."
}