Skip to content

feat: add next-intl i18n, Spanish translation, language selector, glossary tooltips#848

Merged
Ogstevyn merged 2 commits into
Ogstevyn:mainfrom
Adeolu01:i18n
May 31, 2026
Merged

feat: add next-intl i18n, Spanish translation, language selector, glossary tooltips#848
Ogstevyn merged 2 commits into
Ogstevyn:mainfrom
Adeolu01:i18n

Conversation

@Adeolu01

Copy link
Copy Markdown
Contributor

Summary

  • Installs next-intl and configures it via next.config.js using createNextIntlPlugin
  • i18n.ts provides getRequestConfig with locale validation and dynamic message loading
  • middleware.ts runs locale detection from the Accept-Language header, falls back to en, and enables URL-prefix routing (/es/) via localePrefix: "as-needed" so existing routes at /, /connect, /escrow, etc. are unaffected
  • messages/en.json and messages/es.json cover navigation labels, hero section, form fields, error messages, escrow status strings, and language names; Spanish uses formal usted register throughout
  • app/[locale]/layout.tsx wraps the locale segment with NextIntlClientProvider; app/[locale]/page.tsx renders the full landing page using useTranslations so /es/ serves every hero string, nav label, stat, and program card in Spanish
  • components/ui/language-selector.tsx is a dropdown showing flag and language name; selecting a locale navigates to /es or / and persists the preference to localStorage
  • LanguageSelector is added to both the desktop and mobile sections of components/landing/Navbar.tsx
  • lib/glossary.ts defines bilingual (en/es) definitions for escrow, XLM, Soroban, Freighter, gas fee, smart contract, and testnet
  • components/ui/glossary-term.tsx wraps any inline text and shows a tooltip on hover or focus with the definition in the current locale, auto-detected from the URL pathname

Test plan

  • Run npm install to pull in next-intl
  • GET / loads the landing page in English
  • GET /es loads the landing page with all hero and nav strings in Spanish
  • Setting Accept-Language: es header on GET / redirects or serves Spanish
  • Language selector in the navbar toggles between / and /es and persists to localStorage
  • Hovering or focusing the word escrow on a page that uses GlossaryTerm shows the tooltip in the correct locale
  • Existing routes /connect, /escrow, /wallet, /history are unaffected

closes #753
closes #754
closes #757
closes #758

@vercel

vercel Bot commented May 31, 2026

Copy link
Copy Markdown

@Adeolu01 is attempting to deploy a commit to the Stephen's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented May 31, 2026

Copy link
Copy Markdown

@Adeolu01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Ogstevyn Ogstevyn merged commit 27368c4 into Ogstevyn:main May 31, 2026
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants