-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feature(www): Localize text through react-intl #21024
Conversation
www/src/data/intl/en.yaml
Outdated
@@ -0,0 +1,17 @@ | |||
docs.tableOfContents: Table of Contents |
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.
Trying to decide if we should support nested keys like gatsby-plugin-intl. The implementation shouldn't be too difficult. Regardless, it would be good to have some sort of namespacing to delineate different parts of the website (docs vs search vs feedback widget).
], | ||
}, | ||
}, | ||
// { |
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.
Did you run into issues with the RSS feed or what's the context here?
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.
Yeah, it broke because it tried to compile and couldn't find for the translated text in the blog page. We'd need to figure out how to fix this.
Since I read up on LinguiJS yesterday and it has a smaller footprint. Would you be up for considering this instead of react-intl? It's certainly not a blocker, I'm just interested in seeing myself if we could use it instead.
Should this be a follow-up or part of this PR? I looked through it and LGTM 👍 I like the solution for translations files and nested namespaces, that makes it easier to write! |
I’ve looked at lingui and it looks cool, especially the CLI. I’d want to play around with it and see what the workflow would be like for us and translators.
Probably a follow-up. I’m still not sure what would be the right workflow (edit in the monorepo or move to translation repos) so i want to solidify that before I write docs for it |
Closed in favor of #21633 |
Description
Make text in various components localize-able using react-intl. For this PR, I focused on the components and pages that are visible in all gatsby pages (like the navigation) and most crucial to the docs (like the table of contents, sidebar "expand/collapse"). I didn't do components that we might want to disable for non-English languages, such as the feedback form and the email form.
Rationale
See this comment for why we're going with this library in particular.
Issues
react-intl
is 48.2 kB. We need to figure out a way to only import the components we need or switch to a different libraryTODOs
Related Issues
Fixes: #20803