fix: add translation in getServerSideProps (#4390)

pull/4424/head^2
Nafees Nazik 2022-09-14 00:37:10 +05:30 committed by GitHub
parent b22786d7df
commit cefb46dbdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import { GetServerSidePropsContext } from "next"; import { GetServerSidePropsContext } from "next";
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import Head from "next/head"; import Head from "next/head";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { z } from "zod"; import { z } from "zod";
@ -180,6 +181,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
return { return {
props: { props: {
...(await serverSideTranslations(context.locale ?? "", ["common"])),
user: { user: {
...user, ...user,
emailMd5: crypto.createHash("md5").update(user.email).digest("hex"), emailMd5: crypto.createHash("md5").update(user.email).digest("hex"),