🚚 Rename $i18n2 to $i

This commit is contained in:
Iván Ovejero
2021-12-07 17:28:10 +01:00
parent 858d0d0160
commit 94d6136661
66 changed files with 717 additions and 719 deletions

View File

@@ -22,23 +22,23 @@ export const genericHelpers = mixins(showMessage).extend({
displayTimer (msPassed: number, showMs = false): string {
if (msPassed < 60000) {
if (showMs === false) {
return `${this.$n(Math.floor(msPassed / 1000), 'decimal')} ${this.$i18n2.baseText('genericHelpers.sec')}`;
return `${this.$n(Math.floor(msPassed / 1000), 'decimal')} ${this.$i.baseText('genericHelpers.sec')}`;
}
return `${this.$i18n2.number(msPassed / 1000, 'decimal')} ${this.$i18n2.baseText('genericHelpers.sec')}`;
return `${this.$i.number(msPassed / 1000, 'decimal')} ${this.$i.baseText('genericHelpers.sec')}`;
}
const secondsPassed = Math.floor(msPassed / 1000);
const minutesPassed = Math.floor(secondsPassed / 60);
return `${this.$i18n2.number(minutesPassed, 'decimal')}:${this.$i18n2.number(secondsPassed, 'decimal')} ${this.$i18n2.baseText('genericHelpers.min')}`;
return `${this.$i.number(minutesPassed, 'decimal')}:${this.$i.number(secondsPassed, 'decimal')} ${this.$i.baseText('genericHelpers.min')}`;
},
editAllowedCheck (): boolean {
if (this.isReadOnly) {
this.$showMessage({
// title: 'Workflow can not be changed!',
title: this.$i18n2.baseText('genericHelpers.showMessage.title'),
message: this.$i18n2.baseText('genericHelpers.showMessage.message'),
title: this.$i.baseText('genericHelpers.showMessage.title'),
message: this.$i.baseText('genericHelpers.showMessage.message'),
type: 'error',
duration: 0,
});
@@ -57,7 +57,7 @@ export const genericHelpers = mixins(showMessage).extend({
this.loadingService = this.$loading(
{
lock: true,
text: text || this.$i18n2.baseText('genericHelpers.loading'),
text: text || this.$i.baseText('genericHelpers.loading'),
spinner: 'el-icon-loading',
background: 'rgba(255, 255, 255, 0.8)',
},

View File

@@ -179,7 +179,7 @@ export const nodeBase = mixins(
hover: false,
showOutputLabel: nodeTypeData.outputs.length === 1,
size: nodeTypeData.outputs.length >= 3 ? 'small' : 'medium',
hoverMessage: this.$i18n2.baseText('nodeBase.clickToAddNodeOrDragToConnect'),
hoverMessage: this.$i.baseText('nodeBase.clickToAddNodeOrDragToConnect'),
},
endpointHoverStyle: {
fill: getStyleTokenValue('--color-primary'),

View File

@@ -263,8 +263,8 @@ export const pushConnection = mixins(
// Workflow did execute without a problem
this.$titleSet(workflow.name as string, 'IDLE');
this.$showMessage({
title: this.$i18n2.baseText('pushConnection.showMessage.title'),
message: this.$i18n2.baseText('pushConnection.showMessage.message'),
title: this.$i.baseText('pushConnection.showMessage.title'),
message: this.$i.baseText('pushConnection.showMessage.message'),
type: 'success',
});
}

View File

@@ -134,8 +134,8 @@ export const showMessage = mixins(externalHooks).extend({
async confirmMessage (message: string, headline: string, type: MessageType | null = 'warning', confirmButtonText?: string, cancelButtonText?: string): Promise<boolean> {
try {
const options: ElMessageBoxOptions = {
confirmButtonText: confirmButtonText || this.$i18n2.baseText('showMessage.ok'),
cancelButtonText: cancelButtonText || this.$i18n2.baseText('showMessage.cancel'),
confirmButtonText: confirmButtonText || this.$i.baseText('showMessage.ok'),
cancelButtonText: cancelButtonText || this.$i.baseText('showMessage.cancel'),
dangerouslyUseHTMLString: true,
...(type && { type }),
};
@@ -173,7 +173,7 @@ export const showMessage = mixins(externalHooks).extend({
<summary
style="color: #ff6d5a; font-weight: bold; cursor: pointer;"
>
${this.$i18n2.baseText('showMessage.showDetails')}
${this.$i.baseText('showMessage.showDetails')}
</summary>
<p>${node.name}: ${errorDescription}</p>
</details>

View File

@@ -478,8 +478,8 @@ export const workflowHelpers = mixins(
this.$store.commit('removeActiveAction', 'workflowSaving');
this.$showMessage({
title: this.$i18n2.baseText('workflowHelpers.showMessage.title'),
message: this.$i18n2.baseText('workflowHelpers.showMessage.message') + `: "${e.message}"`,
title: this.$i.baseText('workflowHelpers.showMessage.title'),
message: this.$i.baseText('workflowHelpers.showMessage.message') + `: "${e.message}"`,
type: 'error',
});
@@ -552,8 +552,8 @@ export const workflowHelpers = mixins(
this.$store.commit('removeActiveAction', 'workflowSaving');
this.$showMessage({
title: this.$i18n2.baseText('workflowHelpers.showMessage.title'),
message: this.$i18n2.baseText('workflowHelpers.showMessage.message') + `: "${e.message}"`,
title: this.$i.baseText('workflowHelpers.showMessage.title'),
message: this.$i.baseText('workflowHelpers.showMessage.message') + `: "${e.message}"`,
type: 'error',
});

View File

@@ -32,7 +32,7 @@ export const workflowRun = mixins(
// Do not start if the connection to server is not active
// because then it can not receive the data as it executes.
throw new Error(
this.$i18n2.baseText('workflowRun.noActiveConnectionToTheServer'),
this.$i.baseText('workflowRun.noActiveConnectionToTheServer'),
);
}
@@ -91,8 +91,8 @@ export const workflowRun = mixins(
}
this.$showMessage({
title: this.$i18n2.baseText('workflowRun.showMessage.title'),
message: this.$i18n2.baseText('workflowRun.showMessage.message') + ':<br />&nbsp;&nbsp;- ' + errorMessages.join('<br />&nbsp;&nbsp;- '),
title: this.$i.baseText('workflowRun.showMessage.title'),
message: this.$i.baseText('workflowRun.showMessage.message') + ':<br />&nbsp;&nbsp;- ' + errorMessages.join('<br />&nbsp;&nbsp;- '),
type: 'error',
duration: 0,
});
@@ -204,8 +204,8 @@ export const workflowRun = mixins(
this.$titleSet(workflow.name as string, 'ERROR');
this.$showError(
error,
this.$i18n2.baseText('workflowRun.showError.title'),
this.$i18n2.baseText('workflowRun.showError.message') + ':',
this.$i.baseText('workflowRun.showError.title'),
this.$i.baseText('workflowRun.showError.message') + ':',
);
return undefined;
}