Skip to content

refactor: centralize all localizable strings into translation catalogs - #511

Merged
bgatellier merged 2 commits into
mainfrom
refactor/centralized-localizations
Nov 11, 2026
Merged

bgatellier merged 2 commits into
mainfrom
refactor/centralized-localizations

Conversation

@bgatellier

Copy link
Copy Markdown
Collaborator

Configuration Files

  • src/config/site.ts: Moved locale names, meta descriptions, and page titles to translation keys
  • src/config/result-text.ts: Moved all verdict titles, messages, and parameters to translation keys

Translation Catalogs

  • Added ~40+ new keys to both en.json and fr.json:
    • Page titles (PageTitleHome, PageTitleHowItWorks, etc.)
    • Menu items (FooterMenuJoinUs, FooterMenuLegalNotice, etc.)
    • Result verdicts (titles A-G, messages A-G, parameter min/max for size/nodes/requests)
    • Error messages (ErrorAnalysisMessage, MetaDescription)

Components

  • src/components/layout/Header.astro: Updated to use translation for menu button
  • src/components/SectionPage.astro: Updated to use centralized translations
  • src/components/shortcodes/ErrorSection.astro: Changed default message to use ErrorAnalysisMessage translation key
  • src/content/{en,fr}/error/index.mdx: Removed hardcoded messages, now uses locale prop
  • src/scripts/components/BadgeIntegration.ts: Updated for translation usage

Result

All user-facing strings are now centralized in translation files, making the codebase:

  • Easier to maintain
  • More consistent
  • Ready for new locales
  • Free of hardcoded text (except brand name "EcoIndex")

@bgatellier bgatellier self-assigned this Nov 10, 2026
@bgatellier bgatellier added the enhancement New feature or request label Nov 10, 2026
@bgatellier
bgatellier requested a review from vvatelot November 10, 2026 21:52

@vvatelot vvatelot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Really cool to see those kind of improvments !
Thanks @bgatellier

@bgatellier
bgatellier marked this pull request as draft November 11, 2026 13:26
@bgatellier
bgatellier force-pushed the refactor/centralized-localizations branch from 9b28f68 to 5b54d60 Compare November 11, 2026 14:18
@bgatellier
bgatellier marked this pull request as ready for review November 11, 2026 14:22
@bgatellier
bgatellier merged commit 58ae064 into main Nov 11, 2026
4 checks passed
@bgatellier
bgatellier deleted the refactor/centralized-localizations branch November 11, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants