// optional persist:true, // save to localStorage initial:"en-US", // initial value, instead of detecting });
Connecting with i18next
The @pistonite/pure-i18next package provides additional wrapper
for connecting with i18next. See the documentation there for more details.
You will use initLocaleWithI18next instead of initLocale.
Use with React
A React hook is provided in the pure-react package
to get the current locale from React components.
Changing the locale from React components is the same as from outside React,
with setLocale or i18next.changeLanguage, depending on your setup.
Initialize Locale utilities
initLocale
must be called before using the other functions.Connecting with i18next
The
@pistonite/pure-i18next
package provides additional wrapper for connecting with i18next. See the documentation there for more details. You will useinitLocaleWithI18next
instead ofinitLocale
.Use with React
A React hook is provided in the
pure-react
package to get the current locale from React components.Changing the locale from React components is the same as from outside React, with
setLocale
ori18next.changeLanguage
, depending on your setup.