✏️ Add i18n to reportUnsetCredential()

This commit is contained in:
Iván Ovejero 2022-05-05 15:21:53 +02:00
parent 43f7e2c8aa
commit 760ef5a32b
2 changed files with 21 additions and 11 deletions

View file

@ -124,6 +124,23 @@ export const nodeHelpers = mixins(
return false;
},
reportUnsetCredential(credentialType: ICredentialType) {
return {
credentials: {
[credentialType.name]: [
this.$locale.baseText(
'nodeHelpers.credentialsUnset',
{
interpolate: {
credentialType: credentialType.displayName,
},
},
),
],
},
};
},
// Updates the execution issues.
updateNodesExecutionIssues () {
const nodes = this.$store.getters.allNodes;
@ -219,7 +236,7 @@ export const nodeHelpers = mixins(
selectedCredsAreUnusable(node, genericAuthType)
) {
const credential = this.getCredentialTypeByName(genericAuthType);
return reportUnsetCredential(credential);
return this.reportUnsetCredential(credential);
}
if (
@ -232,7 +249,7 @@ export const nodeHelpers = mixins(
if (selectedCredsDoNotExist(node, nodeCredentialType, stored)) {
const credential = this.getCredentialTypeByName(nodeCredentialType);
return reportUnsetCredential(credential);
return this.reportUnsetCredential(credential);
}
}
@ -243,7 +260,7 @@ export const nodeHelpers = mixins(
selectedCredsAreUnusable(node, nodeCredentialType)
) {
const credential = this.getCredentialTypeByName(nodeCredentialType);
return reportUnsetCredential(credential);
return this.reportUnsetCredential(credential);
}
for (const credentialTypeDescription of nodeType!.credentials!) {
@ -469,14 +486,6 @@ function selectedCredsDoNotExist(
return !storedCredsByType.find((c) => c.id === selectedCredsByType.id);
}
function reportUnsetCredential(credentialType: ICredentialType) {
return {
credentials: {
[credentialType.name]: [`Credentials for "${credentialType.displayName}" are not set.`],
},
};
}
declare namespace HttpRequestNode {
namespace V2 {
type AuthParams = {

View file

@ -387,6 +387,7 @@
"nodeErrorView.stack": "Stack",
"nodeErrorView.theErrorCauseIsTooLargeToBeDisplayed": "The error cause is too large to be displayed",
"nodeErrorView.time": "Time",
"nodeHelpers.credentialsUnset": "Credentials for '{credentialType}' are not set.",
"nodeSettings.alwaysOutputData.description": "If active, will output a single, empty item when the output would have been empty. Use to prevent the workflow finishing on this node.",
"nodeSettings.alwaysOutputData.displayName": "Always Output Data",
"nodeSettings.clickOnTheQuestionMarkIcon": "Click the '?' icon to open this node on n8n.io",