Skip to content

feat: add better i18n support#90

Merged
neilime merged 1 commit intomainfrom
copilot/implement-i18n-capabilities
Feb 14, 2026
Merged

feat: add better i18n support#90
neilime merged 1 commit intomainfrom
copilot/implement-i18n-capabilities

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 13, 2026

Pages Restructuring Implementation - COMPLETE ✅

Successfully restructured ALL pages to use the folder-based pattern with fully translated content.

Latest Updates

Privacy policy links corrected (commit 5fb89a3 + follow-up):

  • Fixed French terms page to link to /privacy (French locale)
  • Fixed English terms page to link to /en/privacy (English locale)
  • Ensures links respect the current language context

Privacy and Terms pages now have translated content (commit 5fb89a3):

  • Created content-fr.md and content-en.md for both privacy and terms pages
  • Each language now has its own complete translated markdown content
  • Route files updated to import language-specific content files
  • Removed shared content.md files

All Pages Completed ✅

  • privacy - Markdown page with translated content (fr/en)
  • terms - Markdown page with translated content (fr/en)
  • contact - Simple Astro page with features
  • about - Complex Astro page with team grid
  • sponsoring - Complex Astro page with pricing tiers
  • home (index) - Main landing page with multiple widgets
  • brand-guidelines - Design page with color palette

Folder Structure Pattern

Each page now follows this structure:

pages/
  privacy/
    fr.ts              # French metadata/translations
    en.ts              # English metadata/translations
    content-fr.md      # French markdown content
    content-en.md      # English markdown content
  terms/
    fr.ts              # French metadata/translations
    en.ts              # English metadata/translations
    content-fr.md      # French markdown content
    content-en.md      # English markdown content
  {other-pages}/
    fr.ts              # French translations
    en.ts              # English translations
    _content.astro     # Shared content component
  fr/
    {page}.astro       # French route (imports from folder)
  en/
    {page}.astro       # English route (imports from folder)

Key Improvements

  1. Full Translation: All content including markdown is now translated
  2. Locale-Aware Links: Internal links use correct locale prefixes
  3. Separation of Concerns: Content (translations) separated from presentation (components)
  4. Maintainability: Easy to update translations without touching component code
  5. Type Safety: Typed translation objects with as const
  6. DRY Principle: Single content component shared between both locales (for Astro pages)
  7. Language-Specific Content: Separate markdown files for each language
  8. Routing Fix: Used underscore prefix _content.astro to prevent Astro from treating shared components as routes

Testing Results

  • ✅ All 136 files compile without errors
  • ✅ 0 TypeScript errors
  • ✅ 0 warnings
  • ✅ 0 hints
  • ✅ Both French and English routes functional
  • ✅ Privacy and terms content fully translated
  • ✅ Code review passed with links corrected

The restructuring is now complete with all content fully translated and ready for production!

Original prompt

Implement all i18n capabilities following documentation: https://docs.astro.build/en/recipes/i18n/


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add i18n capabilities following documentation Implement i18n with locale-based routing and translation infrastructure Feb 13, 2026
Copilot AI requested a review from neilime February 13, 2026 18:12
Copy link
Copy Markdown
Member

@neilime neilime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot handle feedbacks

Comment thread application/src/components/common/LanguageAlternates.astro Outdated
Comment thread application/src/i18n/ui.ts
Comment thread application/src/navigation.ts
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 13, 2026

@copilot handle feedbacks

All feedback addressed in cecf026:

  1. ✅ Removed hardcoded default from LanguageAlternates (now throws error if Astro.site is missing)
  2. ✅ Separated translations into individual language files (fr.ts, en.ts)
  3. ✅ Updated navigation to use translation helpers instead of conditionals

Copilot AI requested a review from neilime February 13, 2026 19:20
Copy link
Copy Markdown
Member

@neilime neilime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Handle feedbacks

Comment thread application/src/navigation.ts Outdated
Comment thread application/src/pages/404.astro
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 13, 2026

@copilot Handle feedbacks

All feedback addressed in fc839c2:

  1. ✅ Translated alt text in footer logo using footer.logoAlt translation key
  2. ✅ Refactored 404.astro to use useTranslations() helper instead of inline conditionals

Copilot AI requested a review from neilime February 13, 2026 19:38
Copy link
Copy Markdown
Member

@neilime neilime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot for pages, I want:

  • a folder with technical slug name (in english)
  • an astro or md file using translations helper
  • translation files en/fr

Example:

application/src/pages/privacy/content.md
application/src/pages/privacy/en.ts
application/src/pages/privacy/fr.ts

application/src/pages/home/content.astro
application/src/pages/home/en.ts
application/src/pages/home/fr.ts

Comment thread application/src/navigation.ts Outdated
Comment thread application/src/navigation.ts Outdated
Comment thread application/src/navigation.ts Outdated
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 13, 2026

@copilot for pages, I want:

  • a folder with technical slug name (in english)
  • an astro or md file using translations helper...

I understand you want a new page structure with each page in its own folder containing:

  • content file (.astro or .md)
  • translation files (en.ts, fr.ts)

This is a significant architectural change from the current /fr/ and /en/ directories.

Question: Should I:

  1. Restructure ALL existing pages (index, about, contact, sponsoring, privacy, terms, brand-guidelines) to this new pattern?
  2. Or set up this pattern for a few example pages and update the routing/infrastructure to support it?

Restructuring all pages would involve moving ~14 page files and creating ~28 translation files. Please confirm the scope before I proceed.

Copilot AI requested a review from neilime February 13, 2026 19:56
@neilime
Copy link
Copy Markdown
Member

neilime commented Feb 13, 2026

@copilot Restructure ALL existing pages (index, about, contact, sponsoring, privacy, terms, brand-guidelines) to this new pattern?

At the end I still want routing:

  • root: french pages
  • en/...: English pages

Routing and folder tree structure are different things

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 13, 2026

@copilot Restructure ALL existing pages (index, about, contact, sponsoring, privacy, terms, brand-guidelines) to this new pattern?

...

Understood! I'll restructure all pages to the new folder-based pattern while maintaining the current routing:

  • / (root) → French pages (default locale)
  • /en/ → English pages

The new structure will be:

src/pages/
  privacy/
    content.astro (or .md)
    fr.ts
    en.ts
  home/
    content.astro
    fr.ts
    en.ts
  ...

Then I'll use Astro's routing with [...slug].astro or dynamic routes to serve the correct translated version based on the URL.

Starting implementation now.

Copilot AI changed the title Implement i18n with locale-based routing and translation infrastructure Implement i18n with locale-based routing, translation infrastructure, and folder-based page structure Feb 13, 2026
@neilime neilime changed the title Implement i18n with locale-based routing, translation infrastructure, and folder-based page structure feat: implement i18n with locale-based routing, translation infrastructure, and folder-based page structure Feb 14, 2026
Copilot AI changed the title feat: implement i18n with locale-based routing, translation infrastructure, and folder-based page structure Restructure all pages to folder-based i18n pattern Feb 14, 2026
Copy link
Copy Markdown
Member

@neilime neilime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot handle feedbacks

Comment thread application/src/pages/terms/content-fr.md Outdated
Comment thread application/src/pages/privacy/content.md Outdated
Copilot AI requested a review from neilime February 14, 2026 09:34
@neilime neilime force-pushed the copilot/implement-i18n-capabilities branch from 4189292 to 09b3518 Compare February 14, 2026 16:51
@neilime neilime changed the title Restructure all pages to folder-based i18n pattern feat: add better i18n support Feb 14, 2026
@neilime neilime marked this pull request as ready for review February 14, 2026 16:55
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
@neilime neilime force-pushed the copilot/implement-i18n-capabilities branch from 09b3518 to 55d2ca6 Compare February 14, 2026 17:13
@neilime neilime merged commit 1e22536 into main Feb 14, 2026
9 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

Development

Successfully merging this pull request may close these issues.

2 participants