Translations in a custom widget

Translations in a custom widget

Hi, is it possible to use dictionaries for translating text in a custom widget.
We obviously tried something like:
  1. button.innerHTML = '#CWDGT.BUTTON_TEXT#';
but that didn't work.

Any guidance would be highly appreciated.

Thanks,
Vincent