all repos — caroster @ f61da4df34a45c277877046b84e0b909930ea292

[Octree] Group carpool to your event https://caroster.io

fix: 🌐 Announcement localization (#28)

Simon Mulquin simon@octree.ch
Fri, 29 Sep 2023 18:31:12 +0900
commit

f61da4df34a45c277877046b84e0b909930ea292

parent

d22ff8e226d2461c69805c6b517758526253ca0f

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M frontend/lib/pageUtils.tsfrontend/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 {