Skip to content
This integration is unmaintained due to lack of time. It should mostly work but do not expect fixes or new features.

getDefaultLocalePlaceholder

Allows you to get the default locale inside of getStaticPaths. It’s a build time macro. That means it will be replaced by it’s literal value. For instance:

1
---
2
import { getDefaultLocalePlaceholder } from "i18n:astro"
3
4
export const getStaticPaths = () => {
5
const defaultLocale = getDefaultLocalePlaceholder()
6
7
return []
8
}
9
---

Will be replaced by the following, no matter the context:

1
---
2
import { getDefaultLocalePlaceholder } from "i18n:astro"
3
4
export const getStaticPaths = () => {
5
const defaultLocale = "en"
6
7
return []
8
}
9
---

Be careful not to use getDefaultLocalePlaceholder in interpolations or it could result in invalid code.