-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
React i18next #8406
React i18next #8406
Conversation
✅ ethereum-org-website-dev deploy preview ready
|
…fy our browser & ssr gatsby files
} | ||
|
||
return <Layout {...props}>{element}</Layout> | ||
} |
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.
gatsby-browser
& gatsby-ssr
content was replaced by the usage of gatsby-plugin-layout
.
dangerouslySetInnerHTML={{ | ||
__html: t("page-staking-hierarchy-solo-p1"), | ||
}} | ||
/> |
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.
This is a temporary implementation. In the next iteration we are planning in using the following approach: https://react.i18next.com/latest/trans-component#using-with-react-components where we will also need to modify our translation files.
src/pages-conditional/wallets.tsx
Outdated
@@ -494,7 +478,16 @@ export const listImage = graphql` | |||
` | |||
|
|||
export const query = graphql` | |||
query WalletsPage { | |||
query WalletsPage($language: String!) { | |||
locales: allLocale(filter: { language: { eq: $language } }) { |
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.
On each page, we need to fetch the selected language strings.
When reviewing I noticed a bug with our link styling for links embedded as HTML in JSON files - #8547. |
Uhmm good catch @wackerow! I'm looking into it now. Thanks |
Noticed this on the other PR, but it's also happening here. If a string is not available in a language, I would expect it to fall back to English strings. This is what happens in this PR: |
Good catch @minimalsm I thought I had that covered! will take a look, thanks! |
i18n lib change - use htmr to parse html inside json files #8585
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.
LGTM, nice one
Noting, we need to update /docs/best-practices.md
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.
LGTM :)
@corwintines I'll create a new PR with those updates 👍🏼 thanks for pointing that out. |
Description
Implement
react-i18next
by using the next plugin https://github.com/microapps/gatsby-plugin-react-i18nextKnown issues:
Related Issue
#8345