From d379d7ecf3592142845bf71f82fe6bcd54b76a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Sat, 20 Nov 2021 15:58:21 +0100 Subject: [PATCH] :zap: Render new base strings --- packages/editor-ui/src/components/Node.vue | 32 +++++++++++++------ .../src/components/NodeCredentials.vue | 6 ++-- packages/editor-ui/src/i18n/locales/de.ts | 7 +++- packages/editor-ui/src/i18n/locales/en.ts | 5 +++ 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/packages/editor-ui/src/components/Node.vue b/packages/editor-ui/src/components/Node.vue index 7990c885d3..19cdf3d290 100644 --- a/packages/editor-ui/src/components/Node.vue +++ b/packages/editor-ui/src/components/Node.vue @@ -22,7 +22,7 @@ -
+
@@ -51,11 +51,17 @@
-

{{ nodeTitle }}

-

(Disabled)

+

+ {{ this.$headerText({ + key: `headers.${shortNodeType}.displayName`, + fallback: data.name, + }) + }} +

+

({{ $baseText('node.disabled') }}}

- {{nodeSubtitle}} + {{ nodeSubtitle }}
@@ -128,7 +134,7 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, renderText, workflow const nodeIssues = NodeHelpers.nodeIssuesToString(this.data.issues, this.data); - return 'Issues:
  - ' + nodeIssues.join('
  - '); + return `${this.$baseText('node.issues')}:
  - ` + nodeIssues.join('
  - '); }, nodeDisabledIcon (): string { if (this.data.disabled === false) { @@ -155,8 +161,8 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, renderText, workflow return returnStyles; }, - nodeTitle (): string { - return this.data.name; + shortNodeType (): string { + return this.data.type.replace('n8n-nodes-base.', ''); }, waiting (): string | undefined { const workflowExecution = this.$store.getters.getWorkflowExecution; @@ -166,9 +172,17 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, renderText, workflow if (this.name === lastNodeExecuted) { const waitDate = new Date(workflowExecution.waitTill); if (waitDate.toISOString() === WAIT_TIME_UNLIMITED) { - return 'The node is waiting indefinitely for an incoming webhook call.'; + return this.$baseText('node.theNodeIsWaitingIndefinitelyForAnIncomingWebhookCall'); } - return `Node is waiting till ${waitDate.toLocaleDateString()} ${waitDate.toLocaleTimeString()}`; + return this.$baseText( + 'node.nodeIsWaitingTill', + { + interpolate: { + date: waitDate.toLocaleDateString(), + time: waitDate.toLocaleTimeString(), + }, + }, + ); } } diff --git a/packages/editor-ui/src/components/NodeCredentials.vue b/packages/editor-ui/src/components/NodeCredentials.vue index edb1e96908..a7bc294092 100644 --- a/packages/editor-ui/src/components/NodeCredentials.vue +++ b/packages/editor-ui/src/components/NodeCredentials.vue @@ -73,8 +73,6 @@ import { mapGetters } from "vuex"; import mixins from 'vue-typed-mixins'; -const NEW_CREDENTIALS_TEXT = '- Create New -'; - export default mixins( genericHelpers, nodeHelpers, @@ -87,7 +85,7 @@ export default mixins( ], data () { return { - NEW_CREDENTIALS_TEXT, + NEW_CREDENTIALS_TEXT: `- ${this.$baseText('nodeCredentials.createNew')} -`, newCredentialUnsubscribe: null as null | (() => void), }; }, @@ -193,7 +191,7 @@ export default mixins( }, onCredentialSelected (credentialType: string, credentialId: string | null | undefined) { - if (credentialId === NEW_CREDENTIALS_TEXT) { + if (credentialId === this.NEW_CREDENTIALS_TEXT) { this.listenForNewCredentials(credentialType); this.$store.dispatch('ui/openNewCredential', { type: credentialType }); this.$telemetry.track('User opened Credential modal', { credential_type: credentialType, source: 'node', new_credential: true, workflow_id: this.$store.getters.workflowId }); diff --git a/packages/editor-ui/src/i18n/locales/de.ts b/packages/editor-ui/src/i18n/locales/de.ts index c46ae6ab4d..7dbcff4ceb 100644 --- a/packages/editor-ui/src/i18n/locales/de.ts +++ b/packages/editor-ui/src/i18n/locales/de.ts @@ -265,7 +265,7 @@ export default { }, }, readOnly: { - youreViewingTheLogOf: `You're viewing the log of a previous execution. You cannot
+ youreViewingTheLogOf: `🇩🇪 You're viewing the log of a previous execution. You cannot
make changes since this execution already occured. Make changes
to this workflow by clicking on its name on the left.`, readOnly: '🇩🇪 Read only', @@ -463,14 +463,19 @@ export default { deleteItem: '🇩🇪 Delete item', }, node: { + theNodeIsWaitingIndefinitelyForAnIncomingWebhookCall: '🇩🇪 The node is waiting indefinitely for an incoming webhook call.', + nodeIsWaitingTill: '🇩🇪 Node is waiting till {date} {time}', + disabled: '🇩🇪 Disabled', nodeIsExecuting: '🇩🇪 Node is executing', deleteNode: '🇩🇪 Delete Node', activateDeactivateNode: '🇩🇪 Activate/Deactivate Node', duplicateNode: '🇩🇪 Duplicate Node', editNode: '🇩🇪 Edit Node', executeNode: '🇩🇪 Execute Node', + issues: '🇩🇪 Issues', }, nodeCredentials: { + createNew: '🇩🇪 Create New', credentialFor: '🇩🇪 Credential for {credentialType}', selectCredential: '🇩🇪 Select Credential', issues: '🇩🇪 Issues', diff --git a/packages/editor-ui/src/i18n/locales/en.ts b/packages/editor-ui/src/i18n/locales/en.ts index f3de554449..e32c40cbea 100644 --- a/packages/editor-ui/src/i18n/locales/en.ts +++ b/packages/editor-ui/src/i18n/locales/en.ts @@ -457,14 +457,19 @@ export default { deleteItem: 'Delete item', }, node: { + theNodeIsWaitingIndefinitelyForAnIncomingWebhookCall: 'The node is waiting indefinitely for an incoming webhook call.', + nodeIsWaitingTill: 'Node is waiting till {date} {time}', + disabled: 'Disabled', nodeIsExecuting: 'Node is executing', deleteNode: 'Delete Node', activateDeactivateNode: 'Activate/Deactivate Node', duplicateNode: 'Duplicate Node', editNode: 'Edit Node', executeNode: 'Execute Node', + issues: 'Issues', }, nodeCredentials: { + createNew: 'Create New', credentialFor: 'Credential for {credentialType}', selectCredential: 'Select Credential', issues: 'Issues',