-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Onboarding: Onboarding related packages use react-i18n to translate copy #48232
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~71 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Async-loaded Components (~62 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
Was this the thing we discussed updating i18n data in the useI18n hook so that you could use either? |
@lsl yup that came up in the context of discussing this. However I think updating the data used by |
And it looks like I was wrong anyway, we are already updating |
6e961b1
to
f688d0e
Compare
Does what it says on the tin 👍 Checked the After site creation I tested the launch flow (from the editor) by switching my account to German
I noticed that the text in the table didn't update when I toggled languages, but toggling between RTL languages seemed to force the update? Also I hit If that all sounds normal to you then it LGTM ✅ |
@p-jackson I had a go at invalidating the resolution cache for the plans details grid in: #48391 — I wasn't 100% sure of my approach, so branched from this PR instead of committing here directly. Do you think something like that might solve it? I'm not sure if the cache invalidation solves the issue or just works around a different existing issue that needs to be resolved 🤔 |
f688d0e
to
1ab32c2
Compare
👍 thanks @ramonjd, yes that all sounds normal. I'll merge once I know what the story is with the tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely for me, factoring in the known issues we're working on separately! 😀
Changes proposed in this Pull Request
Copy in the new onboarding flow wasn't updating when switching languages. This happened because we switched onboarding over to use
@wordpress/i18n
as a temporary work around whilereact-i18n
wasn't working in ETK. Now thatreact-i18n
works in ETK we can use it everywhere, meaning components will re-render when the language is switched.@automattic/react-i18n
instead of@wordpress/i18n
There's also an issue with the plan grid text that I was going to fix as part of this PR. But I think that one is going to need a bit of a refactor of the
plans
data store, so will do that in another PR.Testing instructions
/new?flags=gutenboarding/language-picker
cd apps/editing-toolkit && yarn dev --sync
and check that all the steps in the launch flow are still translatedFixes #48196