-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add i18n for screen reader section labels #2249
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
Clever solution! Shame rehype-autolink-headings
doesn’t provide file
etc. as context to its different methods so we could just plug this in there. Made a small naming suggestion & refactor recommendation.
LOVE that this is your first PR back — i18n + a11y in one go 🙌
Co-Authored-By: Chris Swithinbank <[email protected]>
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! Welcome back @Yan-Thomas 🚀
What kind of changes does this PR include?
Description
This PR adds a new rehype plugin to translate the screen reader anchor labels injected by
rehype-autolink-headings
. If the current language doesn't have a translation yet, it will fallback to English.