studio icon indicating copy to clipboard operation
studio copied to clipboard

Add Language Switcher

Open derekblank opened this issue 1 year ago • 1 comments

Related to #

Proposed Changes

(WIP) Adds Language Picker to User Settings modal to allow user to select Studio UI language

Screenshot 2024-05-01 at 2 48 29 pm

Testing Instructions

TBD

Pre-merge Checklist

  • [ ] Have you checked for TypeScript, React or other console errors?

derekblank avatar May 01 '24 04:05 derekblank

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, while localeData is loaded on the main thread (before renderer is invoked) -- therefore, localStorage can'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 avatar May 10 '24 07:05 derekblank

@derekblank Amazing, This is a feature I have been looking forward to. 🙏 Hope Vietnamese available

nguyenquanghoang avatar Aug 01 '24 13:08 nguyenquanghoang

@wojtekn This is awesome

nguyenquanghoang avatar Aug 03 '24 02:08 nguyenquanghoang

  • Closing in favor of https://github.com/Automattic/studio/pull/476

sejas avatar Aug 17 '24 11:08 sejas