Skip to content

Client usage

Client usage is disabled by default because it sends some JavaScript to the browser. Enabling any of the following features requires importing the <I18nClient/> component.

UtilityRequired features
tdata, translations
getLocaledata
getLocalesdata
getDefaultLocaledata
getHtmlAttrsdata
setDynamicParamsN/A, server only
getLocalePathdata, paths
switchLocalePathdata, paths
getSwitcherDatadata, paths
getLocalePlaceholderN/A, getStaticPaths only
getLocalesPlaceholderN/A, getStaticPaths only
getDefaultLocalePlaceholderN/A, getStaticPaths only

You can enable them in your integration config:

astro.config.mjs
1
i18n({
2
// ...
3
client: {
4
data: false,
5
paths: false,
6
translations: false,
7
}
8
})