Render new base strings

This commit is contained in:
Iván Ovejero 2021-11-20 15:58:21 +01:00
parent ed3fa11a86
commit d379d7ecf3
4 changed files with 36 additions and 14 deletions

View file

@ -22,7 +22,7 @@
</span> </span>
</div> </div>
<div class="node-executing-info" title="Node is executing"> <div class="node-executing-info" :title="$baseText('node.nodeIsExecuting')">
<font-awesome-icon icon="sync-alt" spin /> <font-awesome-icon icon="sync-alt" spin />
</div> </div>
@ -51,8 +51,14 @@
</div> </div>
<div class="node-description"> <div class="node-description">
<div class="node-name" :title="data.name"> <div class="node-name" :title="data.name">
<p>{{ nodeTitle }}</p> <p>
<p v-if="data.disabled">(Disabled)</p> {{ this.$headerText({
key: `headers.${shortNodeType}.displayName`,
fallback: data.name,
})
}}
</p>
<p v-if="data.disabled">({{ $baseText('node.disabled') }}}</p>
</div> </div>
<div v-if="nodeSubtitle !== undefined" class="node-subtitle" :title="nodeSubtitle"> <div v-if="nodeSubtitle !== undefined" class="node-subtitle" :title="nodeSubtitle">
{{ nodeSubtitle }} {{ nodeSubtitle }}
@ -128,7 +134,7 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, renderText, workflow
const nodeIssues = NodeHelpers.nodeIssuesToString(this.data.issues, this.data); const nodeIssues = NodeHelpers.nodeIssuesToString(this.data.issues, this.data);
return 'Issues:<br />&nbsp;&nbsp;- ' + nodeIssues.join('<br />&nbsp;&nbsp;- '); return `${this.$baseText('node.issues')}:<br />&nbsp;&nbsp;- ` + nodeIssues.join('<br />&nbsp;&nbsp;- ');
}, },
nodeDisabledIcon (): string { nodeDisabledIcon (): string {
if (this.data.disabled === false) { if (this.data.disabled === false) {
@ -155,8 +161,8 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, renderText, workflow
return returnStyles; return returnStyles;
}, },
nodeTitle (): string { shortNodeType (): string {
return this.data.name; return this.data.type.replace('n8n-nodes-base.', '');
}, },
waiting (): string | undefined { waiting (): string | undefined {
const workflowExecution = this.$store.getters.getWorkflowExecution; const workflowExecution = this.$store.getters.getWorkflowExecution;
@ -166,9 +172,17 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, renderText, workflow
if (this.name === lastNodeExecuted) { if (this.name === lastNodeExecuted) {
const waitDate = new Date(workflowExecution.waitTill); const waitDate = new Date(workflowExecution.waitTill);
if (waitDate.toISOString() === WAIT_TIME_UNLIMITED) { 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(),
},
},
);
} }
} }

View file

@ -73,8 +73,6 @@ import { mapGetters } from "vuex";
import mixins from 'vue-typed-mixins'; import mixins from 'vue-typed-mixins';
const NEW_CREDENTIALS_TEXT = '- Create New -';
export default mixins( export default mixins(
genericHelpers, genericHelpers,
nodeHelpers, nodeHelpers,
@ -87,7 +85,7 @@ export default mixins(
], ],
data () { data () {
return { return {
NEW_CREDENTIALS_TEXT, NEW_CREDENTIALS_TEXT: `- ${this.$baseText('nodeCredentials.createNew')} -`,
newCredentialUnsubscribe: null as null | (() => void), newCredentialUnsubscribe: null as null | (() => void),
}; };
}, },
@ -193,7 +191,7 @@ export default mixins(
}, },
onCredentialSelected (credentialType: string, credentialId: string | null | undefined) { onCredentialSelected (credentialType: string, credentialId: string | null | undefined) {
if (credentialId === NEW_CREDENTIALS_TEXT) { if (credentialId === this.NEW_CREDENTIALS_TEXT) {
this.listenForNewCredentials(credentialType); this.listenForNewCredentials(credentialType);
this.$store.dispatch('ui/openNewCredential', { type: 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 }); this.$telemetry.track('User opened Credential modal', { credential_type: credentialType, source: 'node', new_credential: true, workflow_id: this.$store.getters.workflowId });

View file

@ -265,7 +265,7 @@ export default {
}, },
}, },
readOnly: { readOnly: {
youreViewingTheLogOf: `You're viewing the log of a previous execution. You cannot<br /> youreViewingTheLogOf: `🇩🇪 You're viewing the log of a previous execution. You cannot<br />
make changes since this execution already occured. Make changes<br /> make changes since this execution already occured. Make changes<br />
to this workflow by clicking on its name on the left.`, to this workflow by clicking on its name on the left.`,
readOnly: '🇩🇪 Read only', readOnly: '🇩🇪 Read only',
@ -463,14 +463,19 @@ export default {
deleteItem: '🇩🇪 Delete item', deleteItem: '🇩🇪 Delete item',
}, },
node: { 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', nodeIsExecuting: '🇩🇪 Node is executing',
deleteNode: '🇩🇪 Delete Node', deleteNode: '🇩🇪 Delete Node',
activateDeactivateNode: '🇩🇪 Activate/Deactivate Node', activateDeactivateNode: '🇩🇪 Activate/Deactivate Node',
duplicateNode: '🇩🇪 Duplicate Node', duplicateNode: '🇩🇪 Duplicate Node',
editNode: '🇩🇪 Edit Node', editNode: '🇩🇪 Edit Node',
executeNode: '🇩🇪 Execute Node', executeNode: '🇩🇪 Execute Node',
issues: '🇩🇪 Issues',
}, },
nodeCredentials: { nodeCredentials: {
createNew: '🇩🇪 Create New',
credentialFor: '🇩🇪 Credential for {credentialType}', credentialFor: '🇩🇪 Credential for {credentialType}',
selectCredential: '🇩🇪 Select Credential', selectCredential: '🇩🇪 Select Credential',
issues: '🇩🇪 Issues', issues: '🇩🇪 Issues',

View file

@ -457,14 +457,19 @@ export default {
deleteItem: 'Delete item', deleteItem: 'Delete item',
}, },
node: { 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', nodeIsExecuting: 'Node is executing',
deleteNode: 'Delete Node', deleteNode: 'Delete Node',
activateDeactivateNode: 'Activate/Deactivate Node', activateDeactivateNode: 'Activate/Deactivate Node',
duplicateNode: 'Duplicate Node', duplicateNode: 'Duplicate Node',
editNode: 'Edit Node', editNode: 'Edit Node',
executeNode: 'Execute Node', executeNode: 'Execute Node',
issues: 'Issues',
}, },
nodeCredentials: { nodeCredentials: {
createNew: 'Create New',
credentialFor: 'Credential for {credentialType}', credentialFor: 'Credential for {credentialType}',
selectCredential: 'Select Credential', selectCredential: 'Select Credential',
issues: 'Issues', issues: 'Issues',