Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor i18n docs fixes #2689

Merged
merged 1 commit into from
Jan 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 9 additions & 22 deletions packages/editor-ui/src/plugins/i18n/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The base text file for each locale is located at `/packages/editor-ui/src/plugin
cp ./packages/editor-ui/src/plugins/i18n/locales/en.json ./packages/editor-ui/src/plugins/i18n/locales/de.json
```

2. Find in the UI a string to translate, and search for it in the newly created base text file. Alternatively,find in `/editor-ui` a call to `$locale.baseText(key)`, e.g. `$locale.baseText('workflowActivator.deactivateWorkflow')`, and take note of the key and find it in the newly created base text file.
2. Find in the UI a string to translate, and search for it in the newly created base text file. Alternatively, find in `/editor-ui` a call to `$locale.baseText(key)`, e.g. `$locale.baseText('workflowActivator.deactivateWorkflow')`, and take note of the key and find it in the newly created base text file.

> **Note**: If you cannot find a string in the new base text file, either it does not belong to base text (i.e., the string might be part of header text, credential text, or node text), or the string might belong to the backend, where i18n is currently unsupported.

Expand All @@ -99,8 +99,8 @@ A credential translation file is placed at `/nodes-base/credentials/translations
credentials
└── translations
└── de
├── githubApi.json
└── githubOAuth2Api.json
├── githubApi.json
└── githubOAuth2Api.json
```
Every credential must have its own credential translation file.

Expand All @@ -124,8 +124,8 @@ GitHub
├── GitHubTrigger.node.ts
└── translations
└── de
├── github.json
└── githubTrigger.json
├── github.json
└── githubTrigger.json
```

Every node must have its own node translation file.
Expand Down Expand Up @@ -180,14 +180,6 @@ export class GithubApi implements ICredentialType {
}
```

```json
{
"server": {...},
"user": {...},
"accessToken": {...},
}
```

The object for each node credential parameter allows for the keys `displayName`, `description`, and `placeholder`.

```json
Expand Down Expand Up @@ -215,14 +207,7 @@ Only existing parameters are translatable. If a credential parameter does not ha

> **Note**: All keys are optional. Missing translations trigger a fallback to the `en` locale strings.

Each node translation file is an object that allows for two keys, `header` and `nodeView`, which are the _sections_ of each node translation:

```json
{
"header": { ... },
"nodeView": { ... },
}
```
Each node translation file is an object that allows for two keys, `header` and `nodeView`, which are the _sections_ of each node translation.

The `header` section points to an object that may contain only two keys, `displayName` and `description`, matching the node's `description.displayName` and `description.description`.

Expand Down Expand Up @@ -280,7 +265,9 @@ export class Github implements INodeType {
```json
{
"nodeView": {
"resource": {...},
"resource": {
"displayName": "🇩🇪 Resource",
},
},
}
```
Expand Down