Closed kxrom closed 5 years ago
About i18n-node, where should I register __() to be used within lighterhtml templates?
__()
This is an example implementation for handlebarsjs.com template engine:
// register hbs helpers in res.locals' context which provides this.locale hbs.registerHelper('__', function () { return i18n.__.apply(this, arguments); }); hbs.registerHelper('__n', function () { return i18n.__n.apply(this, arguments); });
lighterhtml is not compatible with node (meaning: it doesn't do SSR)
to use i18n with anything, just use it normally
i18n
html`<div>${i18n`my content`}</div>`
About i18n-node, where should I register
__()
to be used within lighterhtml templates?This is an example implementation for handlebarsjs.com template engine: