Translating
Use tolgee.t
method to translate keys.
domElement.textContent = tolgee.t('key', 'Default value');
However this will not update translation in case you change language or update translation through in-context.
Listening for changes
info
If you use Tolgee with any supported framework, this is solved for you automatically.
You can listen for translation change with update
event.
tolgee.on('update', () => {
domElement.textContent = tolgee.t('key', 'Default value');
});