Umbraco.CMS.Backoffice icon indicating copy to clipboard operation
Umbraco.CMS.Backoffice copied to clipboard

[BUG]: Ensure support localization for aspects of TinyMCE plugins

Open enkelmedia opened this issue 10 months ago • 0 comments

I'm playing with the tinyMcePlugin extension point and noticing that the text for the buttons is hardcoded.

For example the UmbTinyMceLinkPickerPlugin has the tooltip hardcoded in the ctor.

image

Since TinyMcePluginArguments contains the host element I'm guessing that we might be able to create a UmbLocalizationController to be used when calling args.editor.ui.registry.addButton?

const localize = new UmbLocalizationController(args.host);

args.editor.ui.registry.addButton('link', {
	icon: 'link',
	tooltip: localize.term('buttons_linkInsert'),
	onAction: () => this.showDialog(),
});

Would that be correct?

There are also other parts to this:

  • When adding a new tinyMcePlugin extension the meta.toolbar.label is used in the TinyMCE configuration interface but can't use localization here (as far as I understand?)
  • The native buttons in TinyMCE might also need to be handled.

enkelmedia avatar Mar 31 '24 22:03 enkelmedia