i18next / i18next-browser-languageDetector

language detector used in browser environment for i18next
MIT License
874 stars 90 forks source link

My language detector not working #183

Closed hrahimi270 closed 5 years ago

hrahimi270 commented 5 years ago

I did just like the example in documents. This is a screenshot of my code:

Screen Shot 2019-08-10 at 12 04 59 PM

As you can see, I set lookupLocalStorage to language, not the default value. But I test it with the default value. I also clear my localStorage once. I have no idea why it doesn't work!

Note: In the example used reactI18nextModule for init the i18next but it's not exported from it!

jamuhl commented 5 years ago

should work: https://github.com/i18next/i18next-browser-languageDetector/blob/master/src/browserLookups/localStorage.js#L18

but you hardcode lng to "en" not running the detector

setting lng=en on init does just fix lng to en omitting the detector