Synchronous init? #636

megapctr opened this Issue Mar 31, 2016 · 3 comments


None yet

2 participants


Hi, is there a proper way to initialize i18next synchronously?

I import my translations from a json file (via webpack), so they're available instantly. Therefore I'd expect i18n.t to be ready to use as soon as i18n.init is called. Instead, I have to wait for callback to be called.

By browsing through the source code, I came up with this:

    resources: translations,
    lng: language,

It's more of a hack than a solution -- is there a proper way to do this?

jamuhl commented Mar 31, 2016

hm...i see...will call changeLanguage immediatly when passing in resources...will keep you uptodate.

megapctr commented Apr 4, 2016

Works, thanks :)

@megapctr megapctr closed this Apr 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment