I have completed all the steps on the documentation.
Why is the code below not working? For NextJs, SSR cannot be performed on any page except for each pages folder. For example, how do I use the translate for the NavBar? I Couldn't find any solutions. When I useTranslation nothing happen, but when i do first serverSide then useTranslation its work.
"i18next": "^22.4.5", "next": "13.0.6", "next-i18next": "^13.0.1", "react": "18.2.0",
THIS IS WORKS
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { useTranslation } from 'next-i18next'
export const Footer = () => {
const { t } = useTranslation('footer')
return (
<footer>
<p>{t('description')}</p>
</footer>
)
}
export async function getStaticProps({ locale }) {
return {
props: {
...(await serverSideTranslations(locale, [
'common',
'footer',
])),
},
}
}
THIS IS NOT WORKS
import { useTranslation } from 'next-i18next'
export const Footer = () => {
const { t } = useTranslation('footer')
return (
<footer>
<p>{t('description')}</p>
</footer>
)
}
How can I do this work, without ssg,ssr
I search but ı couldn't any asnwer.