From 2aa4caaf252988e782ed59af33c3a4bc5c1b5f2d Mon Sep 17 00:00:00 2001 From: Samuel Plumppu <6125097+Greenheart@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:38:48 +0200 Subject: [PATCH] Ensure SSR and CSR bundles provide consistent i18n config. See https://github.com/i18next/next-i18next/issues/2259 for details --- pages/_app.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pages/_app.tsx b/pages/_app.tsx index da744cc9..9a78387e 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -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 @@ -81,7 +82,7 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) { - {t('cookieBanner.message')} + {t('common:cookieBanner.message')} {getLayout()} @@ -103,4 +104,4 @@ export const getStaticProps: GetStaticProps = async ({ locale }) => ({ }, }) -export default appWithTranslation(MyApp) +export default appWithTranslation(MyApp, nextI18nextConfig)