Skip to content

Commit

Permalink
Ensure SSR and CSR bundles provide consistent i18n config. See i18nex…
Browse files Browse the repository at this point in the history
  • Loading branch information
Greenheart committed Apr 8, 2024
1 parent bca465c commit 2aa4caa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import CookieConsent from 'react-cookie-consent'
import { GetStaticProps, NextPage } from 'next'
import { ReactElement, ReactNode } from 'react'
import { appWithTranslation, useTranslation } from 'next-i18next'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'

import '../styles/globals.css'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import Theme, { colorTheme } from '../Theme'
import nextI18nextConfig from '../next-i18next.config'

type NextPageWithLayout = NextPage & {
getLayout?: (page: ReactElement) => ReactNode
Expand Down Expand Up @@ -81,15 +82,15 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) {
<Theme>
<CookieConsent
location="bottom"
buttonText={t('actions.ok')}
buttonText={t('common:actions.ok')}
style={{ background: colorTheme.lightBlack }}
buttonStyle={{
backgroundColor: colorTheme.midGreen,
fontSize: '13px',
}}
expires={150}
>
{t('cookieBanner.message')}
{t('common:cookieBanner.message')}
</CookieConsent>
{getLayout(<Component {...pageProps} />)}
</Theme>
Expand All @@ -103,4 +104,4 @@ export const getStaticProps: GetStaticProps = async ({ locale }) => ({
},
})

export default appWithTranslation(MyApp)
export default appWithTranslation(MyApp, nextI18nextConfig)

0 comments on commit 2aa4caa

Please sign in to comment.