# Addendum for i18n in n8n ## Base text ### Pluralization Certain base text strings accept [singular and plural versions](https://kazupon.github.io/vue-i18n/guide/pluralization.html) separated by a `|` character: ```json { "tagsView.inUse": "{count} workflow | {count} workflows" } ``` ### Interpolation Certain base text strings use [interpolation](https://kazupon.github.io/vue-i18n/guide/formatting.html#named-formatting) to allow for a variable between curly braces: ```json { "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: ```json { "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: ```json { "_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](https://kazupon.github.io/vue-i18n/guide/messages.html#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. ```json { "_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: ```json { "nodeView.eventTriggerDescription": "πŸ‡©πŸ‡ͺ Waiting for you to call the Test URL" } ``` Cron node: ```json { "nodeView.activationMessage": "πŸ‡©πŸ‡ͺ 'Your cron trigger will now trigger executions on the schedule you have defined." } ```