Aller-Couleur / handlebars-i18n

handlebars-i18next.js adds the internationalization features of i18next and Intl to handlebars.js
Other
16 stars 6 forks source link

Make it possible to have i18next instance as an option #43

Closed alexgarel closed 1 year ago

alexgarel commented 1 year ago

What

handlebars-i18n use the global i18next instance, defined at the module level.

I would like to be able to provide this instance in options as we do for overrideHndlbrs.

Why

https://github.com/i18next/i18next-http-middleware does not change the global i18next but instead clone it, put it as an attribute of the request and change it's language. So I can not use handlebars-i18n with this product. It seems to me that what i18next-http-middleware does is cleaner in this context, for you are sure you wont have inter weaved request interacting badly. If I was able to pass the i18next instance as an option, I would be able to use handlebars-i18n in a middleware that I would put just after i18next-http-middleware

fwalzel commented 1 year ago

Just released new version 1.5.0, it has your requested feature. See readme.md under "Using custom instances of Handlebars and/or i18next". Cheers

fwalzel commented 1 year ago

Done.

fwalzel commented 1 year ago

Closed.

fwalzel commented 1 year ago

:sweat_smile:

alexgarel commented 1 year ago

I integrated it in our project, thanks !