refactor(i18n): dynamic locale routing with [lang] pages#8
Open
ramistodev wants to merge 1 commit intomidudev:mainfrom
Open
refactor(i18n): dynamic locale routing with [lang] pages#8ramistodev wants to merge 1 commit intomidudev:mainfrom
ramistodev wants to merge 1 commit intomidudev:mainfrom
Conversation
- Replace hardcoded pages/es/ with dynamic pages/[lang]/ - getStaticPaths now uses locales/defaultLocale from translations.ts - Remove hardcoded 'es' strings from AlgoViz.tsx and Header.tsx - Add missing translation keys (openMenu, closeMenu, sidebarAriaLabel, etc.)
|
@ramistodev is attempting to deploy a commit to the midudev pro Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves internationalization (i18n) and accessibility across the application, especially for mobile and ARIA labels. It also generalizes locale handling for URLs and algorithm selection, and cleans up translation keys for consistency. The most important changes are grouped below:
Internationalization and Accessibility Improvements:
Replaces hardcoded English/Spanish ARIA labels and mobile UI strings in
AlgoViz.tsxandHeader.tsxwith values from theTranslationsobject, ensuring all labels and mobile titles are properly localized and accessible. [1] [2] [3] [4] [5] [6] [7] [8] [9]Adds new translation keys for ARIA labels and mobile UI elements (e.g.,
sidebarAriaLabel,codePanelAriaLabel,openMenu,closeMenu,viewCode,languageLabel) to theTranslationsinterface and provides translations for both English and Spanish. [1] [2] [3]Generalization of Locale Handling:
Updates URL and algorithm ID parsing logic in
AlgoViz.tsxto support any locale, not just English/Spanish, by using thelocalesanddefaultLocalearrays from the translations module. This makes the app more scalable for future languages. [1] [2]Updates
[algorithm].astropage to usedefaultLocalefor all locale-dependent logic, making the page generation and metadata consistent with the new i18n approach. (src/pages/[algorithm].astroL5-R5, src/pages/[algorithm].astroL17-R22)Translation Key Consistency:
'recursion'→recursion), improving consistency and maintainability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Minor Code Style Improvements:
Header.tsx. [1] [2] [3]Function Signature Cleanup:
getAlgorithmMetaTitleintranslations.tsfor improved readability.These changes together make the app more robust for internationalization, improve accessibility, and lay the groundwork for adding more locales in the future.- Replace hardcoded pages/es/ with dynamic pages/[lang]/