You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our storybook, we have a language picker, that lets us launch our app with any of the supported languages. To reset the language to the default, we used to do this:
Where 'local' is a dummy ID that we assigned to the item in the language picker that corresponds to the default language.
This has been working fine for a while. However, with v1.10.3, setLanguage is typed and will only accept a string parameter, meaning we can't call it with null anymore. Even though it still works, as getLocale() resets the language to the browser's default language if lang isn't given.
So my question is: Are the typings wrong, and should the string parameter be made optional so we can call setLanguage() to reset the language? Or what is the new/recommended way to reset the language?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Bug Description
In our storybook, we have a language picker, that lets us launch our app with any of the supported languages. To reset the language to the default, we used to do this:
Where 'local' is a dummy ID that we assigned to the item in the language picker that corresponds to the default language.
This has been working fine for a while. However, with v1.10.3,
setLanguage
is typed and will only accept a string parameter, meaning we can't call it withnull
anymore. Even though it still works, as getLocale() resets the language to the browser's default language iflang
isn't given.So my question is: Are the typings wrong, and should the string parameter be made optional so we can call
setLanguage()
to reset the language? Or what is the new/recommended way to reset the language?Thanks in advance!
The text was updated successfully, but these errors were encountered: