feat: implement i18n support with next-intl (en/es) (#8)#53
Merged
meshackyaro merged 2 commits intoJun 23, 2026
Merged
Conversation
Sets up internationalization for the frontend using next-intl on the Pages Router, with English and Spanish locales. - next.config.js: enable Next.js built-in locale routing (locales: en, es; defaultLocale: en) — non-default locales are URL-prefixed (e.g. /es/explore) and exposed via useRouter().locale. - messages/en.json + messages/es.json: translation catalogs (Nav + LocaleSwitcher). - i18n/messages.ts: typed locale list, default, isLocale guard, and getMessages() resolver with a safe fallback to the default locale. - pages/_app.tsx: wrap the app in NextIntlClientProvider, selecting the catalog from the active router locale. - components/atoms/locale-switcher: accessible <select> that switches locale while preserving the current route (pathname + query). - components/organisms/navbar: nav links, "Launch App" CTA, and menu aria-labels now come from translations; mounts the locale switcher (desktop + mobile). Verified locally: `npm run typecheck`, `npm run lint`, and `npm run build` all pass (no TypeScript/ESLint errors).
|
@anuoluwaponiorimi is attempting to deploy a commit to the Meshack Yaro 's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
CI is failing. Please fix |
next@13.4 pins @swc/helpers@0.5.1, while next-intl's runtime peer-requires @swc/helpers >=0.5.17, so a correct tree nests @swc/helpers@0.5.23 under next-intl. The lockfile was missing that nested entry, which made `npm ci` fail with "package.json and package-lock.json not in sync" on CI. Regenerated the lockfile with npm 10 (Node 20, matching CI) so the nested dependency is recorded. Verified `npm ci`, lint, typecheck, and build all pass on Node 20.
meshackyaro
approved these changes
Jun 23, 2026
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.
Summary
Implements internationalization (#8): sets up next-intl to support English and Spanish initially, integrated with the project's Next.js Pages Router via Next's built-in locale routing.
What changed
next.config.js— enables Next.js locale routing (locales: ['en','es'],defaultLocale: 'en'). Non-default locales are URL-prefixed (e.g./es/explore) and the active locale is exposed viauseRouter().locale.messages/en.json+messages/es.json— translation catalogs (Nav,LocaleSwitcher).i18n/messages.ts— typedlocales/defaultLocale, anisLocaletype guard, and agetMessages()resolver that falls back to the default locale safely.pages/_app.tsx— wraps the app inNextIntlClientProvider, selecting the catalog from the active router locale (statically imported, so no per-pagegetStaticPropsboilerplate).components/atoms/locale-switcher— an accessible<select>that switches locale while preserving the current route (pathname + query).components/organisms/navbar— nav links, the "Launch App" CTA, and the menu aria-labels are now translated; the locale switcher is mounted on both desktop and mobile.Architectural notes
pages/, noapp/), so this uses Next's built-ini18nrouting +NextIntlClientProvider(the documented Pages Router approach) rather than the App Router[locale]segment + middleware.useTranslations()— the infrastructure is now in place.Acceptance criteria
next-intlto support English and Spanish locales initially.npm run typecheckandnpm run lintare clean).actions/setup-nodecache: npm+node_modulescache) — unchanged.Testing (matches CI: lint, typecheck, build on Node 18 & 20)
npm run typecheck✅ (no TS errors)npm run lint✅ ("No ESLint warnings or errors")npm run build✅ (all 30 routes build; locale routing active)New dependency:
next-intl(^4.13.0).