studio
studio copied to clipboard
Add Language Switcher
Related to #
Proposed Changes
(WIP) Adds Language Picker to User Settings modal to allow user to select Studio UI language
Testing Instructions
TBD
Pre-merge Checklist
- [ ] Have you checked for TypeScript, React or other console errors?
Updating with some notes, findings, and next steps:
- [x] 🎨 The
<LanguagePicker />onChange event will need to handle the locale change. - [x] 💾 The updated preferred locale string should persist in some form of local storage across sessions.
- [x] 🔍 Investigate:
<LanguagePicker />events exist on the renderer thread, whilelocaleDatais loaded on the main thread (before renderer is invoked) -- therefore,localStoragecan't be used to persist user locale changes (without modifying one or other other). - [x] 🔍 Investigate: saveUserData may be the best place to save and load any user-preferred locale string changes.
- [ ] 🔍 Investigate: Currently, the JSON translation files are loaded synchronously using
require, and would need an app restart to load the new locale data. Potentially, the JSON translation files could be loaded async without the need to restart Studio to change the Studio UI language/locale. - [x] 🏁 All of the above changes should only apply to the Studio app UI itself (and not any Studio-created sites), minimizing the footprint of changes.
@derekblank Amazing, This is a feature I have been looking forward to. 🙏 Hope Vietnamese available
@wojtekn This is awesome
- Closing in favor of https://github.com/Automattic/studio/pull/476