Server Side Loading
// pages/index.ts
// Can be used with `getServerSideProps` as well
export const getStaticProps = async (props) => {
return {
props: {
...(await loadTranslations(ni18nConfig, props.locale, [
'server-namespace',
])),
},
}
}// pages/index.ts
export const getStaticProps = async (props) => {
return {
props: {
...(await loadTranslations(ni18nConfig, props.locale, [
'server-namespace',
])),
...clientNamespaces(['client-namespace']),
},
}
}Last updated