I'm struggling with next-i18next integration in a NextJS Typescript project - has nearly no recent examples anywhere. I've already configured internationalized routing, but I can't properly setup i18next as long as getServerSideProps syntax is bothering me.
I don't know much about Typescript, and am not familiar with types declarations yet.
The code looks like this, mostly copied from next-i18next documentation :
### index.tsx
// rest of index.tsx...
export const getServerSideProps: GetServerSideProps = async ({locale}) => ({
props: {
...await serverSideTranslations(locale, ['common', 'header']),
},
})
export default Home
An error is thrown in my IDE about "locale". Even though I'm using getServerSideProps, i'm not even sure that it is the best solution for a mostly static project, but it seems I can't avoid it if I'm planning a SSR in the end. A simple way to deliver correctly translated content + having a matching URL locale would be awesome.