Skip to content

Translation package - #100

Open
melijimenez11 wants to merge 1845 commits into
devfrom
translation-package
Open

Translation package#100
melijimenez11 wants to merge 1845 commits into
devfrom
translation-package

Conversation

@melijimenez11

@melijimenez11 melijimenez11 commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

This branch implements i18n migration - next-intl integration for apps/main

What changed

  • Installed next-intl at the monorepo root (available to all apps) and restructured apps/main routes under app/[locale]/
  • Added messages/en.json and messages/es.json with a few of the homepage strings (only video hero and about panel have been tested thus far. Refer to those when you're testing)
  • Created packages/i18n/src/RichTextComponent.tsx - a centralized rich text tag system (<bold>, <italic>, <p>, <br>) for use with t.rich() across all apps
  • Added accentItalic typography variant to the shared theme (Merriweather italic, inherits parent font size)
  • Wired up LanguageSwitcher in Header.tsx with client-side locale detection via LocaleDetector
  • Added switchLocale utility in app/lib/ for hard navigation between locales (required for static export)
  • Fixed app/layout.tsx to be a pass-through shell - <html> and <body> now owned by [locale]/layout.tsx
  • Removed middleware (incompatible with output: "export")
  • Fixed AboutCtaLink to use component="span" on Typography subtitle1
  • Deprecated TranslationProvider and useTranslation exports in packages/i18n - still exported for storyline-flow and storyline-climate which have not been migrated yet
  • Updated README internationalization section

How to test

  1. Navigate to localhost:[port]/en - verify homepage renders in English
  2. Click "Español" in the header - verify page switches to /es with Spanish content
  3. Hard refresh on /es - verify it stays in Spanish
  4. Clear cookies, set browser language to Spanish, visit / - verify redirect to /es

Known issues not introduced by this PR

  • EquityPanel.tsx has a pre-existing type error (Type 'undefined' cannot be used as an index type) that fails the build. This exists on dev as well.
  • Multiple pre-existing lint warnings across scenarioExplorer, map, and viz packages - not introduced by this branch.
  • The paragraph in VideoHero shifts width slightly after page load. This is caused by --coeqwal-nav-left being set after hydration. The shift was pre-existing but became more noticeable after adding showLanguageSwitcher to Header.tsx - see inline comment on that line.

Notes

  • TranslationProvider is intentionally kept in packages/i18n - do not remove until storyline-flow and storyline-climate are migrated
  • The EquityPanel.tsx build error needs to be fixed separately before this branch can fully pass CI
  • We should probably make bold and italic text behave the same at the theme level, because currently you need to pass italic as an sx prop, but bold uses fontWeight: ....

@melijimenez11

Copy link
Copy Markdown
Collaborator Author

Hi @fantauzza

I noticed the paragraph on VideoHero shifts width after the page loads. Adding showLanguageSwitcher to Header.tsx in this PR made it visible - the LanguageSwitcher renders and widens the nav, which triggers the ResizeObserver in BaseHeader to remeasure and update --coeqwal-nav-left, causing the paragraph to reposition.

Was aligning this paragraph to the nav's left edge a firm design requirement? If so, do you have a preferred way to set an initial value for --coeqwal-nav-left before hydration to avoid the jump? Let me know what you think

@melijimenez11
melijimenez11 requested a review from fantauzza April 22, 2026 21:14
@fantauzza
fantauzza requested a review from yunhsinkuo as a code owner June 30, 2026 20:58
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.

5 participants