Add autocompletion for i18n keys in script sections of Vue files (#3133)

* 📘 Type `baseText()` to i18n keys

* 📘 Adjust `baseText()` signature

* 👕 Except JSON files from Vue ESLint

* 🐛 Fix errors surfaced by `baseText()` typing

*  Pluralize keys

* 📘 Add typing for category names

*  Mark internal keys

* ✏️ Update docs references

* 🎨 Prettify syntax

* 🐛 Fix leftover internal key references
This commit is contained in:
Iván Ovejero
2022-04-15 08:22:58 +02:00
committed by GitHub
parent 8532b0030d
commit 18dee373d5
13 changed files with 95 additions and 55 deletions

View File

@@ -125,13 +125,16 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, workflowHelpers).ext
if (this.nodeType !== null && this.nodeType.hasOwnProperty('eventTriggerDescription')) {
const nodeName = this.$locale.shortNodeType(this.nodeType.name);
const { eventTriggerDescription } = this.nodeType;
return this.$locale.nodeText().eventTriggerDescription(nodeName, eventTriggerDescription);
return this.$locale.nodeText().eventTriggerDescription(
nodeName,
eventTriggerDescription || '',
);
} else {
return this.$locale.baseText(
'node.waitingForYouToCreateAnEventIn',
{
interpolate: {
nodeType: this.nodeType && getTriggerNodeServiceName(this.nodeType.displayName),
nodeType: this.nodeType ? getTriggerNodeServiceName(this.nodeType.displayName) : '',
},
},
);