From a109a85232a61be323483b4535cd102c25e3ff54 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 5 Mar 2022 13:54:23 -0800 Subject: [PATCH] Send locale when creating a user --- components/SignupModal/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/SignupModal/index.tsx b/components/SignupModal/index.tsx index 7f3dadf7..5a28b70e 100644 --- a/components/SignupModal/index.tsx +++ b/components/SignupModal/index.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react' import { useCookies } from 'react-cookie' +import { useRouter } from 'next/router' import { Trans, useTranslation } from 'next-i18next' import { AxiosResponse } from 'axios' @@ -27,6 +28,7 @@ interface ErrorMap { const emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ const SignupModal = (props: Props) => { + const router = useRouter() const { t } = useTranslation('common') // Set up form states and error handling @@ -59,7 +61,8 @@ const SignupModal = (props: Props) => { username: usernameInput.current?.value, email: emailInput.current?.value, password: passwordInput.current?.value, - password_confirmation: passwordConfirmationInput.current?.value + password_confirmation: passwordConfirmationInput.current?.value, + language: router.locale } }