The docs for textarea buttons have an example toolbar button:
panel.plugin("getkirby/custom-textarea-buttons", {
textareaButtons: {
highlight: {
label: "Highlight",
icon: "wand",
click: function () {
this.command("toggle", "<mark>", "</mark>")
},
shortcut: "m",
},
}
});
I’d like to translate the label, “Highlight”. Using label: panel.$t('foo') does not work. panel.$t() is not defined.
However, when I log panel.$t('foo') inside the click handler I get my translated string in the console.
How can I translate the button label?