fix: 🌐 Announcement localization (#28)
Simon Mulquin simon@octree.ch
Fri, 29 Sep 2023 18:31:12 +0900
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
frontend/lib/pageUtils.ts
→
frontend/lib/pageUtils.ts
@@ -17,11 +17,12 @@
const getServerSideProps = (extension?: ServerSideExtension) => async (context: any) => { const session = await getSession(context); + const lang = context.req.cookies['NEXT_LOCALE']; const {STRAPI_URL = 'http://localhost:1337'} = process.env; const jwt = session?.token?.jwt; const apolloClient = initializeApollo(`${STRAPI_URL}/graphql`, jwt); - const locale = session?.user?.lang || 'fr'; + const locale = lang || session?.user?.lang || 'fr'; try { const {