Closed kumar303 closed 5 years ago
For any component that needs to listen for lang changes, we can probably just provide a higher order component that provides a lang
property connected to state.
This did change that the number is no longer modified but the strings didn't change either. The number formatting is not the problem it's that we need to modify the context to change the strings.
I know but the locale redirect (which reloads the page, yes) stores lang in Redux state already so why not use Redux state everywhere in the app? This will prepare us for the future when we can use Redux alone to switch locales (which seems possible to me, just with a little effort).
We only use the context to create the Jed instance. I have a patch that works without the moment stuff (functions aren't serializing in redux state from server, our library supports it but I left it out).
There is a partially working implementation of this in mozilla/addons-frontend#1641 but it has since bit rotted. Could be a good place to start or use for inspiration if someone wants to tackle this.
This issue has been automatically marked as stale because it has not had recent activity. If you think this bug should stay open, please comment on the issue with further details. Thank you for your contributions.
Describe the problem and steps to reproduce it:
What happened?
Before https://github.com/mozilla/addons-frontend/pull/1627 you could see the user count change from something like '1,905 Users' to '1.905 Users'. After that PR it no longer changes.
What did you expect to happen?
I expect language changes to be visible everywhere in the app after a Redux state change.
Anything else we should know?
By using Redux we reap the following benefits (and possibly more):
None of this is a blocker for release since the lang switcher currently does a redirect.