Skip to content

External Resource: How to internationalize an Astro site with Locize #417

@adrai

Description

@adrai

Hey!

I've written a step-by-step walkthrough on using Locize for translation management with Astro 6, layered on top of Astro's built-in i18n routing. I'd like to add it to the Astro Tips external resources section if it's a fit.

The post: How to internationalize an Astro site with Locize (also published in DE / FR / IT).

What it covers:

  • Configuring Astro's built-in i18n routing (astro.config.mjs, prefixDefaultLocale: true, dynamic [lang]/ routes via getStaticPaths)
  • Build-time JSON sync from the Locize CDN via locize-cli into src/i18n/locales/{lng}/{ns}.json
  • A ~5-line useTranslations(lang) helper layered on Astro's own i18n recipe pattern
  • Three workflows for landing new keys (locize sync / i18next-cli extraction / Locize web app)
  • When to mount a framework island (@astrojs/react / @astrojs/vue) for the cases the static layer can't cover (runtime saveMissing, live CDN-backed fetch, in-context editing)

Companion repo: locize-astro-example — full working Astro 6 + Locize reference implementation.

Why this might add value: there are no Locize / TMS / translation-management entries in the current resources.json, and Astro's i18n recipe intentionally stops at the file-based JSON layer — anyone wanting a centralized translator workflow has to bridge that gap themselves. This post documents one such bridge.

Where exactly should I add this resource in src/content/resources.json? Looks like entries are sorted alphabetically by domain, so it'd land somewhere in the l* range — happy to follow whatever convention you prefer.

Disclosure: I'm one of the Locize maintainers — happy to soften the framing or rewrite anything that reads too promotionally for the Astro Tips voice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions