0

I'm using the browser language detector for i18next.

I'm using the default precedence, which is

['querystring', 'cookie', 'localStorage', 'navigator', 'htmlTag', 'path', 'subdomain']

I want to be able to set localStorage.i18nextLng dynamically, and have i18next update the language, but still respect the detection precedence.

Is there a way to tell i18next to run the language detector again? Or is there another way to accomplish this?

brandones
  • 1,847
  • 2
  • 18
  • 36

1 Answers1

2

You can change the local storage value and then trigger i18next.changeLanguage() to change on runtime.

felixmosh
  • 32,615
  • 9
  • 69
  • 88