Skip to content

getLocalePath

Allows you get the right url for the current locale. It’s strictly typed and even requires you to pass parameters as needed.

1
---
2
import { getLocalePath } from "i18n:astro"
3
4
getLocalePath("/")
5
getLocalePath("/about")
6
getLocalePath("/blog/[slug]", {
7
slug: "hello-world"
8
})
9
---