SeriesAstro Narrow Practical Guide4 / 5

Organizing Multilingual Content and Internal Links

Keep Italian and English content, routes, taxonomy terms, and base-aware links predictable.

Astro Narrow uses Italian as the default locale and includes English as an example second locale. The URL structure is intentionally asymmetric: Italian pages have no /it/ prefix, while English pages live below /en/.

Mirror content by locale directory#

Place translated entries in matching collection directories:

src/content/posts/it/deploy-github-pages.md
src/content/posts/en/deploy-github-pages.md

Matching filenames make the relationship easy to understand, but each file remains a complete content entry with its own title, description, dates, body, categories, and tags. A translation can be added later without blocking the original article.

Localize display taxonomy#

Archive terms are local display values rather than cross-language IDs:

# Italian
categories: ["Guide"]
tags: ["Routing", "Astro"]
# English
categories: ["Guides"]
tags: ["Routing", "Astro"]

This keeps authoring simple and makes the filters read naturally. It also means the theme does not automatically infer that Guide and Guides are the same entity; maintain naming consistency inside each locale.

Generate internal paths through helpers#

Use getLocalePath(locale, path) for system and content links. It handles both the default-locale rule and ASTRO_BASE:

/archives/
getLocalePath('it', '/archives/')
getLocalePath('en', '/archives/')
// /en/archives/

On a project Pages deployment, both results also receive the configured repository base. Language switching uses switchLocalePath() so components do not need to split locale and base segments themselves.

Verify both route shapes#

After adding a locale or changing navigation, build once with ASTRO_BASE=/astro-narrow/. Confirm that Italian paths do not gain /it/, English paths keep /en/, and assets, Archives links, search results, RSS, and sitemap all stay inside the project base.

License

CC BY-NC-SA 4.0 This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Related Posts