handlebars-i18n
handlebars-i18n copied to clipboard
Text is undefined and 'Missing helper: "__" '
I am getting 'undefined' for the text when checked inside storybook. And it throws 'Missing helper: "__" ' error when I try to run the local dev server ? I used npm i handlebars-i18n to install the required dependencies and in my js file I have imported them as follows. Please let me know if I am missing something
import 'handlebars'; import i18next from 'i18next'; import HandlebarsI18n from 'handlebars-i18n';
HandlebarsI18n.init(); const initialize = () => { i18next.init({ resources: { en: { translation: { phrase1: 'What is good?', phrase2: '{{thing}} is good.', }, }, de: { translation: { phrase1: 'Was ist gut?', phrase2: '{{thing}} ist gut.', }, }, }, lng: 'en', }); };
document.addEventListener('DOMContentLoaded', initialize);