logo hsb.horse

Architecture Decision Record

i18n URL strategy for an Astro site

Keep Japanese as the default (root) and serve additional languages under subdirectory prefixes.

Accepted #astro #i18n #seo #architecture

i18n URL strategy for an Astro site

Decision

  • Use a subdirectory prefix URL structure.
  • Set prefixDefaultLocale: false in Astro i18n.
  • Default language (ja) stays at the root (e.g. /posts/slug).
  • Additional languages (en, etc.) use prefixes (e.g. /en/posts/slug).
  • Keep the same slug across languages.

Context

We needed to support multilingual content using AI/translation workflows while preserving the following constraints:

  • Keep existing Japanese URLs intact to preserve SEO and inbound links.
  • Stay aligned with Astro’s file-based routing for low maintenance.
  • Treat Japanese as the source of truth.

Options

  • Option A (Suffix): /posts/slug/en
    • Poor fit with Astro’s standard i18n routing.
  • Option B (Root English): / as English and move Japanese to /ja/
    • Requires changing existing Japanese URLs.
  • Option C (Prefix + JA Default): Keep / as Japanese and put English under /en/
    • Preserves URLs while enabling i18n.

Rationale

  • Backward compatibility: No URL changes for existing Japanese content.
  • Lower implementation cost: Achievable with Astro’s built-in i18n configuration.
  • Quality and trust: Easier to separate original content from translations.

Consequences

  • Non-Japanese visitors landing on / will see Japanese.
  • If needed, add a language suggestion UI or an Accept-Language based redirect.
  • hreflang and cross-language links are easy to generate with Astro helpers.
  • Enforcing identical slugs across languages becomes a content management rule.