feat(i18n): make DocsPageFooter navigation labels translatable#7943
feat(i18n): make DocsPageFooter navigation labels translatable#7943rickhanlonii merged 1 commit intoreactjs:mainfrom
Conversation
Size changesDetails📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 Five Pages Changed SizeThe following pages changed size from the code in this PR compared to its base branch:
DetailsOnly the gzipped size is provided here based on an expert tip. First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If Any third party scripts you have added directly to your app using the Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this. |
rickhanlonii
left a comment
There was a problem hiding this comment.
It would be nice if all the translatable text in JS was moved to a single file so they can all be translated in one place. So this would be something like:
import i18n from './i18n';
// ...
{type === 'Previous' ? i18n.previous : i18n.next}There are libraries that do this, but this use case is simple enough I think we can just implement something manually.
Summary
This PR updates the DocsPageFooter component to support translation of navigation labels (“Previous” and “Next”).
Before
• Labels for navigation were hardcoded ({type}), preventing proper i18n.
• Could not override or translate them based on locale.
After
• Labels are now conditionally rendered:
{type === 'Previous' ? 'Previous' : 'Next'}