Skip to content
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

feat(storybook): add storybook-react-i18next addon #10234

Merged

Conversation

TylerAPfledderer
Copy link
Contributor

@TylerAPfledderer TylerAPfledderer commented May 17, 2023

Description

Adds the storybook-react-i18next addon to the project storybook.

  • Merges the namespace resources for each language under the default "translation" ns to easily access the ids without declaring a specific namespace
  • Sets a default set of languages to test, plus the supported languages declared in the user's local .env
  • Converts the storybook main.js file to TypeScript
  • Converts the Storybook 'preview.js` file to storybook and updates the object per version 7 migration.

Related Issue

Discussion #9879

@github-actions github-actions bot added the dependencies 📦 Changes related to project dependencies label May 17, 2023
@gatsby-cloud
Copy link

gatsby-cloud bot commented May 17, 2023

✅ ethereum-org-website-dev deploy preview ready

@TylerAPfledderer
Copy link
Contributor Author

@pettinarip at the time of this comment, regarding the file conflicts:

  • .storybook/main.js: the new ts file needs the staticDirs: ["../static"] option
  • .storybook/preview.js: the new ts file needs import "../static/fonts/inter-font-face.css"

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition @TylerAPfledderer

Would you mind if I add some translations to the existing stories in this PR?

.storybook/i18next.ts Outdated Show resolved Hide resolved
.storybook/i18next.ts Outdated Show resolved Hide resolved
@TylerAPfledderer
Copy link
Contributor Author

Would you mind if I add some translations to the existing stories in this PR?

@pettinarip made the suggested changes. All good with me! 😄

@github-actions github-actions bot added the content 🖋️ This involves copy additions or edits label Jun 21, 2023
Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @TylerAPfledderer I ended up removing the "buildLangs" since it was adding too much languages to the SB which I don't think we really need right now. For testing purposes, the baseLocales are just enough and makes the build ligther. Later, if we consider that we need more langs we can add them.

@TylerAPfledderer
Copy link
Contributor Author

FYI @TylerAPfledderer I ended up removing the "buildLangs" since it was adding too much languages to the SB which I don't think we really need right now. For testing purposes, the baseLocales are just enough and makes the build ligther. Later, if we consider that we need more langs we can add them.

@pettinarip I agree. All good with me! 😄

@pettinarip pettinarip merged commit 8830d2b into ethereum:dev Jun 29, 2023
@TylerAPfledderer TylerAPfledderer deleted the feat/storybook-react-i18-addon branch June 29, 2023 23:52
This was referenced Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits dependencies 📦 Changes related to project dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants