Skip to content
Rangga Prastio
ID
← Back

Clean i18n in Astro

A pattern for managing bilingual content with Content Collections without logic duplication.

Published , astro, i18n, typescript

Managing two languages often ends up messy because strings are scattered everywhere. The fix: one central dictionary, pure locale helpers, and thin routes.

A Proven Structure

  • All UI strings live in one dictionary file.
  • Markdown content carries a lang field.
  • Routes only forward the locale to components.

The result: adding a new language means adding one dictionary entry and a mirror route folder.

Got a hard part? Send it over.

Freelance and contract work, 20–40 hours a week. I usually reply within 24 hours.

Email me

ranggaprastio123@gmail.com

Shared working hours

Your time
--:--
Rangga’s time
19:58
UTC+7