From 6ab5d4c923b48979c27e53031696d4d850f94112 Mon Sep 17 00:00:00 2001 From: Joe Karow <58997957+JoeKarow@users.noreply.github.com> Date: Mon, 18 Mar 2024 11:17:35 -0400 Subject: [PATCH] fix: i18n loading/lang change (#1160) fix i18n loading --- apps/app/src/pages/_app.tsx | 11 +---------- apps/app/src/pages/search/[...params]/index.tsx | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/apps/app/src/pages/_app.tsx b/apps/app/src/pages/_app.tsx index 798faf5456..774dc2a619 100644 --- a/apps/app/src/pages/_app.tsx +++ b/apps/app/src/pages/_app.tsx @@ -97,16 +97,7 @@ const MyApp = (appProps: AppPropsWithGridSwitch) => { ) } -const i18NextSSRConfig: UserConfig = { - i18n: { - defaultLocale: nextI18nConfig.i18n.defaultLocale, - locales: nextI18nConfig.i18n.locales, - }, - interpolation: nextI18nConfig.interpolation, - use: nextI18nConfig.use, -} - -export default api.withTRPC(appWithTranslation(MyApp, i18NextSSRConfig)) +export default api.withTRPC(appWithTranslation(MyApp, nextI18nConfig)) export type NextPageWithOptions = NextPage & { omitGrid?: boolean diff --git a/apps/app/src/pages/search/[...params]/index.tsx b/apps/app/src/pages/search/[...params]/index.tsx index 8e3071f855..aa26c86291 100644 --- a/apps/app/src/pages/search/[...params]/index.tsx +++ b/apps/app/src/pages/search/[...params]/index.tsx @@ -305,7 +305,7 @@ export const getServerSideProps: GetServerSideProps, '/s const ssg = await trpcServerClient({ req, res }) const [i18n] = await Promise.allSettled([ - getServerSideTranslations(locale, ['services', 'common', 'attribute', 'country']), + getServerSideTranslations(locale, ['services', 'common', 'attribute']), ssg.organization.searchDistance.prefetch({ lat, lon, dist, unit, skip, take }), ssg.organization.getNatlCrisis.prefetch({ cca2: country }), ssg.service.getFilterOptions.prefetch(),