From 18f0e128b949ac308e4ebfa34b703a00b7e0bfae Mon Sep 17 00:00:00 2001 From: ajnart Date: Fri, 2 Sep 2022 19:19:33 +0200 Subject: [PATCH] :bug: Fix bug with i18n and login screen --- next-i18next.config.js | 1 - src/pages/404.tsx | 2 +- src/pages/login.tsx | 10 ++++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/next-i18next.config.js b/next-i18next.config.js index 18812db5b..c0f90fcf1 100644 --- a/next-i18next.config.js +++ b/next-i18next.config.js @@ -18,7 +18,6 @@ module.exports = { 'sl', 'sv', 'uk', - 'zh ', ], fallbackLng: 'en', localeDetection: true, diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 166b3df31..5ed2a87c5 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -98,7 +98,7 @@ export default function Custom404() { export async function getStaticProps({ locale }: { locale: string }) { return { props: { - ...(await serverSideTranslations(locale, ['404'])), + ...(await serverSideTranslations(locale, ['common'])), // Will be passed to the page component as props }, }; diff --git a/src/pages/login.tsx b/src/pages/login.tsx index d6df4d33c..7fe0db813 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -6,6 +6,7 @@ import axios from 'axios'; import { IconCheck, IconX } from '@tabler/icons'; import { useRouter } from 'next/router'; import { useForm } from '@mantine/form'; +import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; // TODO: Add links to the wiki articles about the login process. export default function AuthenticationTitle() { @@ -113,3 +114,12 @@ export default function AuthenticationTitle() { ); } + +export async function getStaticProps({ locale }: { locale: string }) { + return { + props: { + ...(await serverSideTranslations(locale, ['common'])), + // Will be passed to the page component as props + }, + }; +}