-
Notifications
You must be signed in to change notification settings - Fork 195
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
Spike: i18n coverage/test cases in Storybook #3368
base: main
Are you sure you want to change the base?
Conversation
|
File metricsSummaryTotal size: 4.26 MB* 🎉 No changes detected in any packages * Size determined by adding together the size of the main file for all packages in the library.* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
b69100b
to
c117928
Compare
🚀 Deployed on https://pr-3368--spectrum-css.netlify.app |
15b9603
to
4628945
Compare
4628945
to
9ebee06
Compare
{ value: "ko", title: "Korean", right: "한국어" }, | ||
{ value: "ar", title: "Arabic", right: "عربي" }, | ||
{ value: "zh", title: "Chinese", right: "中文" }, | ||
{ value: "fa", title: "Persian", right: "فارسی" }, |
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.
I did not see Persian on the list of supported locales, we certainly still could support it though!
Description
This work is part of a spike (CSS-849) to investigate how we might expand Storybook stories and test coverage to include more non-English examples. This draft PR builds upon some of the existing work done in #2916 but with more consistent, controlled language examples, which better allows for testing of text strings that are known to be problematic and also allows for visual regression testing using consistent, repeatable examples.
In order to explore how this might be done, a story ("With Locale Text") has been added to the text field component. This story makes use of an updated language picker and changes the text in the story to match the chosen locale. Translations are currently coming from a single
.json
file with all locales in the.storybook
directory, although this can be adjusted, for instance if we decide that we want translations to be housed somewhere else, or if we want a different translation file for each locale (similar to the React team's approach).When switching to testing preview, which gives an idea of how VRTs might look, sample text from each locale is displayed. This is an example of one way that we might expand i18 coverage and add test cases for components.
Text strings in this example were generated by AI and may not be accurate. We can hunt down more accurate test strings when we're in touch with the team that does translations.
Screenshots
Text field With Locale Text story with language picker set to Thai, as seen in the preview:
Storybook Testing Preview:
Considerations
I've asked in Slack to learn the specifics on which locales to cover, which components to cover, and how to obtain the best translations. Based on that, here are my thoughts on the best way forward:
Potential breakdown of work
Part 1: adding internationalization to higher-priority components
For each component, we would need to:
We could split into multiple cards by component, perhaps 3-4 components per card - this would amount to something like 3 Jira tickets.
Part 2: expanding locales to include the ones it's recommended we support
This would likely be 1 Jira ticket
Part 3: adding internationalization to lower-priority components
This would need to be split into multiple Jira tickets, but given that there are many components here, it might be better to keep all of them listed on one Jira ticket for now with the intention of breaking them up when we're closer to being ready to pick up this work.