From 427e40326ccc99f4e231994a434d1ddb8206093a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 23 Nov 2021 13:29:33 +0100 Subject: [PATCH] :pencil2: Clarify deep nesting in collections --- packages/editor-ui/src/i18n/README.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/editor-ui/src/i18n/README.md b/packages/editor-ui/src/i18n/README.md index 9b1ef64a92..d5c4553d20 100644 --- a/packages/editor-ui/src/i18n/README.md +++ b/packages/editor-ui/src/i18n/README.md @@ -12,8 +12,7 @@ Currently, n8n does _not_ allow for internalization of: - messages from outside the `editor-ui` package, e.g. `No active database connection`, - node subtitles, e.g. `create: user` or `getAll: post` below the node name on the canvas, -- new version notification contents in the updates panel, e.g. `Includes node enhancements`, -- deeply nested parameters inside `collection` and `fixedCollection` (untested feature). +- new version notification contents in the updates panel, e.g. `Includes node enhancements`. ## Locale identifiers @@ -507,7 +506,6 @@ Allowed keys: `displayName`, `description`, `placeholder`, and `multipleValueBut ``` ```js -// node translation: /packages/nodes-base/nodes/Github/translations/de.ts module.exports = { github: { header: {}, @@ -523,17 +521,33 @@ module.exports = { displayName: '🇩🇪 Label', description: '🇩🇪 Label to add to issue.', }, + + // fixed collection + additionalParameters: { + displayName: '🇩🇪 Additional Fields', + options: { + author: { + displayName: '🇩🇪 Author', + }, + }, + }, + // fixed collection item - same level of nesting + author: { + displayName: '🇩🇪 Author', + }, }, }, }; ``` -To reduce excessive nesting, a parameter inside a collection's `options` parameter sits at the same level of nesting as the containing collection in the `nodeView` section. +To reduce nesting and to share translations, a parameter inside a collection's or fixed collection's `options` parameter sits at the same level of nesting as the containing collection in the `nodeView` section.

+> **Note**: In case of deep nesting, i.e. a child of a child of a `collection` and `fixedCollection` parameter, the deeply nested child in principle should be translatable at the same level of nesting as the `collection` and `fixedCollection` parameter, but this has not been fully tested for this first release. + #### Reusable dynamic text Also, the base text file may contain the special key `reusableDynamicText`, allowing for a node parameter to be translated once and reused elsewhere in other node parameter translations.