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

fix: don't render application until we are sure the locale is initialized #525

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

amcgee
Copy link
Member

@amcgee amcgee commented Mar 1, 2021

Because we set the locale state in a useEffect, there was a subtle race condition bug which could cause the application to render before the locale is set. When this happens, strings in the app are not correctly translated because the locale hasn't yet been switch from English to whatever the user has selected.

@amcgee amcgee requested a review from varl March 1, 2021 14:06
@amcgee amcgee merged commit 4329e8e into master Mar 2, 2021
@amcgee amcgee deleted the fix-i18n-race-condition branch March 2, 2021 02:23
dhis2-bot added a commit that referenced this pull request Mar 2, 2021
## [5.7.3](v5.7.2...v5.7.3) (2021-03-02)

### Bug Fixes

* don't render application until we are sure the locale is initialized ([#525](#525)) ([4329e8e](4329e8e))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 5.7.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

4 participants