Skip to content

feat: add multi-language support (EN/PT/ES)#55

Merged
favasconcelos merged 4 commits into
mainfrom
feature/i18n
Jul 18, 2026
Merged

feat: add multi-language support (EN/PT/ES)#55
favasconcelos merged 4 commits into
mainfrom
feature/i18n

Conversation

@favasconcelos

Copy link
Copy Markdown
Owner

Summary

Adds lightweight, dependency-free internationalization to the portfolio site with support for English, Portuguese, and Spanish.

What's included

  • Custom i18n layer (src/i18n/)
    • React Context + Provider for locale state, persistence, and browser-language detection.
    • Typed locale union (en | pt | es) and translation shape.
    • Full translation files for EN, PT, and ES covering all sections.
  • Language switcher (src/components/language-switcher.tsx)
    • Fixed top-right pill with EN / PT / ES buttons.
    • Persists the choice to localStorage under preferred-language.
  • Translated sections
    • Hero, About, Experience, Skills, Contact, and skip-to-content link.
  • HTML lang attribute syncs with the active language.
  • No new runtime dependencies — keeps the bundle minimal.

Detection order

  1. Saved preference from localStorage
  2. Browser language (navigator.languages / navigator.language)
  3. Fallback to English

Validation

  • npm run fmt
  • npm run check
  • npm run build

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deploying portifolio with  Cloudflare Pages  Cloudflare Pages

Latest commit: 00f92c3
Status: ✅  Deploy successful!
Preview URL: https://27e40fcf.portifolio-1p0.pages.dev
Branch Preview URL: https://feature-i18n.portifolio-1p0.pages.dev

View logs

The plugin generated a dist/wrangler.json with an 'assets' field that Cloudflare Pages rejects. The site is a static SPA, so the plugin is unnecessary.
…cher styling

- Renamed locale from pt to br (Portuguese → Brazilian Portuguese)

- Mapped pt / pt-BR browser languages to br

- Improved language switcher colors: subtler active state, hover feedback, glass backdrop
Translated strings were used as React keys, causing elements to unmount/remount when switching languages. This broke scroll-reveal observations and made content briefly disappear. Switched to stable array indices for translated arrays.
@favasconcelos
favasconcelos merged commit 4994583 into main Jul 18, 2026
2 checks passed
@favasconcelos
favasconcelos deleted the feature/i18n branch July 18, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant