Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locale is changed after the story rendered -> play function unusable #20

Closed
bolbovic opened this issue May 25, 2023 · 2 comments
Closed

Comments

@bolbovic
Copy link

Some of my stories are using the play function but the problem is that it seems that the locale are changing in every story: I am seeing this i18next: languageChanged ja for every stories I go on.
What happens is:

  • story renders
  • play function plays
  • language change
    => story re-renders and break the changes made by the play function

First, I was thinking that the play function was stopped by the language change but I added some waiting time at the end of the play function and the interesting thing is that the language change happens after the play function has ended, not during it.

Shouldn't the language not change at all when it's not passed in param and such not trigger the language change? Is there any way I can fix this?

I also wanted to try to add parameter: { locale: "en" }, (default language is ja) to the story and in this case, the rendering is even weirder.

  • story renders (ja)
  • play function plays
  • language change to ja ??
  • story renders
  • language change to en
  • story renders

Ideal outcome should be:

  • language change to en
  • story renders
  • play function plays

Is it possible to manage that?

@stevensacks
Copy link
Owner

Thanks for reporting this. I will take a look.

@stevensacks
Copy link
Owner

stevensacks commented Jun 6, 2023

@bolbovic I believe this has been fixed in v2.0.4

I made some Play tests and they're all working as expected.

Please update and let me know! I'll close the ticket for now and if it's still broken, please reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants