Files
Automata/packages/editor-ui/src/plugins/i18n/docs/ADDENDUM.md
Iván Ovejero 4ae0f5b6fb fix(editor): Fix i18n issues (#3072)
* 🐛 Fix `defaultLocale` watcher

*  Improve error handling for headers

* ✏️ Improve naming

* 🐛 Fix hiring banner check

*  Flatten base text keys

*  Fix miscorrected key

*  Implement pluralization

* ✏️ Update docs

* 🚚 Move headers fetching to `App.vue`

* fix hiring banner

*  Fix missing import

* ✏️ Alphabetize translations

*  Switch to async check

* feat(editor): Refactor Output Panel + fix i18n issues (#3097)

* update main panel

* finish up tabs

* fix docs link

* add icon

* update node settings

* clean up settings

* add rename modal

* fix component styles

* fix spacing

* truncate name

* remove mixin

* fix spacing

* fix spacing

* hide docs url

* fix bug

* fix renaming

* refactor tabs out

* refactor execute button

* refactor header

* add more views

* fix error view

* fix workflow rename bug

* rename component

* fix small screen bug

* move items, fix positions

* add hover state

* show selector on empty state

* add empty run state

* fix binary view

* 1 item

* add vjs styles

* show empty row for every item

* refactor tabs

* add branch names

* fix spacing

* fix up spacing

* add run selector

* fix positioning

* clean up

* increase width of selector

* fix up spacing

* fix copy button

* fix branch naming; type issues

* fix docs in custom nodes

* add type

* hide items when run selector is shown

* increase selector size

* add select prepend

* clean up a bit

* Add pagination

* add stale icon

* enable stale data in execution run

* Revert "enable stale data in execution run"

8edb68dbffa0aa0d8189117e1a53381cb2c27608

* move metadata to its own state

* fix smaller size

* add scroll buttons

* update tabs on resize

* update stale data on rename

* remove metadata on delete

* hide x

* change title colors

* binary data classes

* remove duplicate css

* add colors

* delete unused keys

* use event bus

* update styles of pagination

* fix ts issues

* fix ts issues

* use chevron icons

* fix design with download button

* add back to canvas button

* add trigger warning disabled

* show trigger warning tooltip

* update button labels for triggers

* update node output message

* fix add-option bug

* add page selector

* fix pagination selector bug

* fix executions bug

* remove hint

* add json colors

* add colors for json

* add color json keys

* fix select options bug

* update keys

* address comments

* update name limit

* align pencil

* update icon size

* update radio buttons height

* address comments

* fix pencil bug

* change buttons alignment

* fully center

* change order of buttons

* add no output message in branch

* scroll to top

* change active state

* fix page size

* all items

* update expression background

* update naming

* align pencil

* update modal background

* add schedule group

* update schedule nodes messages

* use ellpises for last chars

* fix spacing

* fix tabs issue

* fix too far data bug

* fix executions bug

* fix table wrapping

* fix rename bug

* add padding

* handle unkown errors

* add sticky header

* ignore empty input, trim node name

* nudge lightness of color

* center buttons

* update pagination

* set colors of title

* increase table font, fix alignment

* fix pencil bug

* fix spacing

* use date now

* address pagination issues

* delete unused keys

* update keys sort

* fix prepend

* fix radio button position

* Revert "fix radio button position"

ae42781786f2e6dcfb00d1be770b19a67f533bdf

Co-authored-by: Mutasem <mutdmour@gmail.com>
Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com>
2022-04-11 15:12:13 +02:00

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."
}