Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip custom plugin #1414

Open
gerritwitkamp opened this issue Jun 27, 2024 · 0 comments
Open

Tooltip custom plugin #1414

gerritwitkamp opened this issue Jun 27, 2024 · 0 comments

Comments

@gerritwitkamp
Copy link

gerritwitkamp commented Jun 27, 2024

Maybe I'm missing something, but how can I support multilanguage for the button's tooltip of my custom plugin?
In the examples I see this.title is set in the add method of the plugin, that doesn't seem to work for me. I also tried to extend the language object which is used as lang property in the options argument of SunEditor.create, unfortunately that didn't work either. I scanned the source code, but I did not found a line of code where the tooltip should be translated (_createButton). Seems like it's just using the plugin name.

How can I fix this?

The only I get around is using the onLoad event, like:

instance.onload = (core, reload) => { core.context.element.toolbar.querySelector('[data-command="foo"] .se-tooltip-inner .se-tooltip-text').textContent= 'bar'; }
Thanks in advance.

Version

2.46.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant