Skip to content

switchLocalePath

Allows you to get the equivalent path of the current route in any locale.

1
---
2
import { switchLocalePath } from "i18n:astro"
3
4
const enPath = switchLocalePath("en") // /about
5
const frPath = switchLocalePath("fr") // /fr/a-propos
6
---