aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/contact.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/contact.tsx')
-rw-r--r--src/pages/contact.tsx10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/pages/contact.tsx b/src/pages/contact.tsx
index 66f4f9e..cb88b7d 100644
--- a/src/pages/contact.tsx
+++ b/src/pages/contact.tsx
@@ -5,7 +5,7 @@ import { seo } from '@config/seo';
import { t } from '@lingui/macro';
import { sendMail } from '@services/graphql/mutations';
import { NextPageWithLayout } from '@ts/types/app';
-import { loadTranslation } from '@utils/helpers/i18n';
+import { defaultLocale, loadTranslation } from '@utils/helpers/i18n';
import { GetStaticProps, GetStaticPropsContext } from 'next';
import Head from 'next/head';
import { FormEvent, useState } from 'react';
@@ -176,16 +176,14 @@ ContactPage.getLayout = getLayout;
export const getStaticProps: GetStaticProps = async (
context: GetStaticPropsContext
) => {
- const translation = await loadTranslation(
- context.locale!,
- process.env.NODE_ENV === 'production'
- );
-
const breadcrumbTitle = t`Contact`;
+ const { locale } = context;
+ const translation = await loadTranslation(locale || defaultLocale);
return {
props: {
breadcrumbTitle,
+ locale,
translation,
},
};