✏️ Minor docs fixes

This commit is contained in:
Iván Ovejero 2021-11-23 14:07:16 +01:00
parent 7a07eefc2f
commit 059c4899a5

View file

@ -41,7 +41,6 @@ export default {
analytics: '🇩🇪 Analytics', analytics: '🇩🇪 Analytics',
communication: '🇩🇪 Communication', communication: '🇩🇪 Communication',
}, },
// ...
``` ```
### Translating base text ### Translating base text
@ -78,7 +77,6 @@ export default {
saving: '🇩🇪 Saving', saving: '🇩🇪 Saving',
saved: '🇩🇪 Saved', saved: '🇩🇪 Saved',
}, },
// ...
``` ```
To [localize decimal values](https://vue-i18n.intlify.dev/guide/essentials/number.html#basic-usage), add this key to the base text: To [localize decimal values](https://vue-i18n.intlify.dev/guide/essentials/number.html#basic-usage), add this key to the base text:
@ -90,7 +88,6 @@ export default {
style: 'decimal', style: 'decimal',
}, },
}, },
// ...
} }
``` ```
@ -159,17 +156,16 @@ export class Github implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {
displayName: 'GitHub', displayName: 'GitHub',
description: 'Consume GitHub API', description: 'Consume GitHub API',
name: 'github', // key to use in translation name: 'github', // key to use in translation
icon: 'file:github.svg', icon: 'file:github.svg',
group: ['input'], group: ['input'],
version: 1, version: 1,
// ...
``` ```
```js ```js
module.exports = { module.exports = {
github: {}, // key from node's description.name github: {}, // key from node's description.name
githubTrigger: {}, // key from node's description.name githubTrigger: {}, // key from node's description.name
}; };
``` ```
@ -205,7 +201,6 @@ export class Github implements INodeType {
icon: 'file:github.svg', icon: 'file:github.svg',
group: ['input'], group: ['input'],
version: 1, version: 1,
// ...
``` ```
```js ```js
@ -238,11 +233,10 @@ In the examples below, the node credential source is located at `/packages/nodes
```js ```js
export class GithubApi implements ICredentialType { export class GithubApi implements ICredentialType {
name = 'githubApi'; // key to use in translation name = 'githubApi'; // key to use in translation
displayName = 'Github API'; displayName = 'Github API';
documentationUrl = 'github'; documentationUrl = 'github';
properties: INodeProperties[] = [ properties: INodeProperties[] = [
// ...
``` ```
```js ```js
@ -250,7 +244,7 @@ module.exports = {
github: { github: {
header: {}, header: {},
credentialsModal: { credentialsModal: {
githubApi: {} // key from node credential name githubApi: {} // key from node credential name
}, },
nodeView: {}, nodeView: {},
}, },
@ -280,7 +274,7 @@ export class GithubApi implements ICredentialType {
}, },
{ {
displayName: 'Access Token', displayName: 'Access Token',
name: 'accessToken', // key to use in translation name: 'accessToken', // key to use in translation
type: 'string', type: 'string',
default: '', default: '',
}, },
@ -291,19 +285,15 @@ export class GithubApi implements ICredentialType {
```js ```js
module.exports = { module.exports = {
github: { github: {
header: { header: {},
// ...
},
credentialsModal: { credentialsModal: {
githubApi: { githubApi: {
server: {} // key from node credential parameter name server: {} // key from node credential parameter name
user: {} // key from node credential parameter name user: {} // key from node credential parameter name
accessToken: {} // key from node credential parameter name accessToken: {} // key from node credential parameter name
}, },
}, },
nodeView: { nodeView: {},
// ...
},
}, },
}; };
``` ```
@ -346,17 +336,15 @@ export class Github implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {
displayName: 'GitHub', displayName: 'GitHub',
name: 'github', name: 'github',
// ...
properties: [ properties: [
{ {
displayName: 'Resource', displayName: 'Resource',
name: 'resource', // key to use in translation name: 'resource', // key to use in translation
type: 'options', type: 'options',
options: [], options: [],
default: 'issue', default: 'issue',
description: 'The resource to operate on.', description: 'The resource to operate on.',
}, },
// ...
``` ```
```js ```js
@ -365,7 +353,7 @@ module.exports = {
header: {}, header: {},
credentialsModal: {}, credentialsModal: {},
nodeView: { nodeView: {
resource: {}, // key from node parameter name resource: {}, // key from node parameter name
}, },
}, },
}; };
@ -381,13 +369,12 @@ Allowed keys: `displayName`, `description`, and `placeholder`.
```js ```js
{ {
displayName: 'Repository Owner', // translatable displayName: 'Repository Owner',
name: 'owner', name: 'owner', // key to use in translation
type: 'string', type: 'string',
required: true, required: true,
// ... placeholder: 'n8n-io',
placeholder: 'n8n-io', // translatable description: 'Owner of the repository.',
description: 'Owner of the repository.', // translatable
}, },
``` ```
@ -397,7 +384,7 @@ module.exports = {
header: {}, header: {},
credentialsModal: {}, credentialsModal: {},
nodeView: { nodeView: {
owner: { owner: { // key from node parameter name
displayName: '🇩🇪 Repository Owner', displayName: '🇩🇪 Repository Owner',
placeholder: '🇩🇪 n8n-io', placeholder: '🇩🇪 n8n-io',
description: '🇩🇪 Owner of the repository.', description: '🇩🇪 Owner of the repository.',
@ -419,21 +406,21 @@ Allows subkeys: `options.{optionName}.displayName` and `options.{optionName}.des
```js ```js
{ {
displayName: 'Resource', // translatable displayName: 'Resource',
name: 'resource', name: 'resource',
type: 'options', type: 'options',
options: [ options: [
{ {
name: 'File', // translatable name: 'File',
value: 'file', value: 'file', // key to use in translation
}, },
{ {
name: 'Issue', // translatable name: 'Issue',
value: 'issue', value: 'issue', // key to use in translation
}, },
], ],
default: 'issue', default: 'issue',
description: 'The resource to operate on.', // translatable description: 'The resource to operate on.',
}, },
``` ```
@ -470,12 +457,12 @@ Allowed keys: `displayName`, `description`, `placeholder`, and `multipleValueBut
```js ```js
{ {
displayName: 'Labels', // translatable displayName: 'Labels',
name: 'labels', name: 'labels', // key to use in translation
type: 'collection', type: 'collection',
typeOptions: { typeOptions: {
multipleValues: true, multipleValues: true,
multipleValueButtonText: 'Add Label', // translatable multipleValueButtonText: 'Add Label',
}, },
displayOptions: { displayOptions: {
show: { show: {
@ -490,11 +477,11 @@ Allowed keys: `displayName`, `description`, `placeholder`, and `multipleValueBut
default: { 'label': '' }, default: { 'label': '' },
options: [ options: [
{ {
displayName: 'Label', // translatable displayName: 'Label',
name: 'label', name: 'label', // key to use in translation
type: 'string', type: 'string',
default: '', default: '',
description: 'Label to add to issue.', // translatable description: 'Label to add to issue.',
}, },
], ],
}, },