# Custom Handlebars Template for Plugin

**URL:** https://meta.discourse.org/t/custom-handlebars-template-for-plugin/138156
**Category:** Development
**Created:** [January 9, 2020, 3:03pm UTC](https://meta.discourse.org/t/custom-handlebars-template-for-plugin/138156 "2020-01-09T15:03:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![AlexanderFillbrunn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexanderfillbrunn/32/165671_2.png) [@AlexanderFillbrunn](https://meta.discourse.org/u/AlexanderFillbrunn)
#### Post date: [January 9, 2020, 3:03pm UTC](https://meta.discourse.org/t/custom-handlebars-template-for-plugin/138156/1 "2020-01-09T15:03:00Z")

</div>

Hi,  
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?  
Kind regards  
Alexander

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [January 9, 2020, 3:37pm UTC](https://meta.discourse.org/t/custom-handlebars-template-for-plugin/138156/2 "2020-01-09T15:37:45Z")

</div>

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:

[https://github.com/discourse/discourse/blob/master/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js.es6#L14](https://github.com/discourse/discourse/blob/master/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js.es6#L14)

and

> <https://github.com/discourse/discourse/blob/main/plugins/discourse-local-dates/config/locales/client.en.yml#L10>

---

<div class="post-metadata">

### Author: ![AlexanderFillbrunn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexanderfillbrunn/32/165671_2.png) [@AlexanderFillbrunn](https://meta.discourse.org/u/AlexanderFillbrunn)
#### Post date: [January 9, 2020, 4:30pm UTC](https://meta.discourse.org/t/custom-handlebars-template-for-plugin/138156/3 "2020-01-09T16:30:07Z")

</div>

Hi,  
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!  
Alex
