In my plugin I have added a new button to the toolbar using the API’s addButton method. Now I would like to show a custom text when the user hovers over the button, just like “Insert date/time” when hovering over the calendar icon. However, setting the label property does not seem to work, I guess due to lacking i18n information. How can I register and access localized labels?
You should probably use the title attribute (instead of label) and set its value to the localized i18n variable defined in
config/locals/client.en.yml for your plugin.
Here is how the
discourse-local-dates plugin does it:
I just spend 40 minutes debugging until I found out that my yml file ended up in config instead of config/locales Thank you for your help!