import Link from 'next/link' import { useRouter } from 'next/router' import type { GetStaticProps, InferGetStaticPropsType } from 'next' import { useTranslation, Trans } from 'next-i18next' import { serverSideTranslations } from 'next-i18next/serverSideTranslations' import { Header } from '../components/Header' import { Footer } from '../components/Footer' type Props = { // Add custom props here } const Homepage = ( _props: InferGetStaticPropsType ) => { const router = useRouter() const { t, i18n } = useTranslation('common') // eslint-disable-next-line @typescript-eslint/no-unused-vars const onToggleLanguageClick = (newLocale: string) => { const { pathname, asPath, query } = router router.push({ pathname, query }, asPath, { locale: newLocale }) } // eslint-disable-next-line @typescript-eslint/no-unused-vars const clientSideLanguageChange = (newLocale: string) => { i18n.changeLanguage(newLocale) } const changeTo = router.locale === 'en' ? 'de' : 'en' // const changeTo = i18n.resolvedLanguage === 'en' ? 'de' : 'en' return ( <>

{t('blog.appDir.question')}

Then check out this blog post.

{t('blog.optimized.question')}

Then you may have a look at this blog post .

{t('blog.ssg.question')}

Then you may have a look at this blog post.


{/* alternative language change without using Link component */} {/* alternative language change without using Link component, but this will change language only on client side */}