Skip to content

Commit

Permalink
Merge pull request #126 from Macktireh/main
Browse files Browse the repository at this point in the history
New version: translate pages and texts into English
  • Loading branch information
Macktireh authored Jul 28, 2024
2 parents b9bd7f1 + c478f8e commit ed29933
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 93 deletions.
2 changes: 1 addition & 1 deletion src/components/homePrivate/CardTweet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const CardTweet: React.FC<propsTypes> = ({ currentUser, post, users, disabledToo
<span>@{authorPost.pseudo}</span>
</Link>
<span>·</span>
<span>{tweet?.created && `il y a ${timeSince(dateParserCreated(tweet.created))}`}</span>
<span>{tweet?.created && `${timeSince(dateParserCreated(tweet.created))} ago`}</span>
</p>
)}
<Tippy
Expand Down
4 changes: 2 additions & 2 deletions src/components/homePrivate/PopupDeletePost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const PopupDeletePost = () => {
? propsContext.popupDeletePost.popupActiveDeletePost
: false
}
popupTitle="Vous êtes sûr de vouloir supprimer ?"
popupBtnText="Oui Supprimer"
popupTitle="Are you sure you want to delete?"
popupBtnText="Yes Delete"
handleDiscard={handleDelete}
handleClose={handleClosePopup}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/components/postDetails/PopupDeleteComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const PopupDeleteComment = () => {
? propsContext.popupDeleteComment.popupActiveDeleteComment
: false
}
popupTitle="Vous êtes sûr de vouloir supprimer ?"
popupBtnText="Oui Supprimer"
popupTitle="Are you sure you want to delete?"
popupBtnText="Yes Delete"
handleDiscard={handleDelete}
handleClose={handleClosePopup}
/>
Expand Down
8 changes: 4 additions & 4 deletions src/components/profile/EdidProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const EdidProfile: React.FC<propsTypes> = ({ currentUser }) => {
id="first_name"
name="first_name"
type="text"
label="Prénom"
label="First Name"
maxLength="50"
onChange={propsContext?.handleChange}
value={propsContext?.userData.first_name ? propsContext.userData.first_name : ""}
Expand All @@ -108,7 +108,7 @@ const EdidProfile: React.FC<propsTypes> = ({ currentUser }) => {
id="last_name"
name="last_name"
type="text"
label="Nom"
label="Last Name"
maxLength="50"
onChange={propsContext?.handleChange}
value={propsContext?.userData.last_name ? propsContext.userData.last_name : ""}
Expand All @@ -118,7 +118,7 @@ const EdidProfile: React.FC<propsTypes> = ({ currentUser }) => {
id="pseudo"
name="pseudo"
type="text"
label="Pseudo"
label="Username"
maxLength="50"
onChange={propsContext?.handleChange}
value={propsContext?.userData.pseudo ? propsContext.userData.pseudo : ""}
Expand All @@ -127,7 +127,7 @@ const EdidProfile: React.FC<propsTypes> = ({ currentUser }) => {
nameClass="entry-container"
id="bio"
name="bio"
label="bio"
label="Bio"
maxLength="160"
onChange={propsContext?.handleChange}
value={propsContext?.userData.bio ? propsContext.userData.bio : ""}
Expand Down
12 changes: 9 additions & 3 deletions src/hooks/UseLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,18 @@ const useLogin = async (
setDisplayError(true);
if (
error.response.data.errors === "L'email ou le mot de passe n'est pas valide !" ||
error.response.data.errors === "Veuillez confirmer votre adresse e-mail !"
error.response.data.errors === "The email or the password is not valid!"
) {
setDetailError(error.response.data.errors);
// setDetailError(error.response.data.errors);
setDetailError("The email or the password is not valid!");
} else if (
error.response.data.errors === "Veuillez confirmer votre adresse e-mail !" ||
error.response.data.errors === "Please confirm your email address!"
) {
setDetailError("Please confirm your e-mail address!");
} else if (error.response.data.errors.email[0] === "Saisissez une adresse e-mail valide.") {
setDetailError(error.response.data.errors.email[0]);
} else setDetailError("L'email ou le mot de passe n'est pas valide !");
} else setDetailError("The email or the password is not valid!");
loginAction();
}
};
Expand Down
6 changes: 3 additions & 3 deletions src/pages/auth/AccountActivationSuccess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ const AccountActivationSuccess: React.FC = () => {
<img src="/static/svg/success.svg" alt="" />
<br />
<br />
<h2>Votre compte a été créé et activé avec succès !</h2>
<h2>Your account has been created and activated successfully!</h2>
<br />
<p>Vous pouvez continuer et vous connecter maintenant.</p>
<p>You can proceed and log in now.</p>
<br />
<Link to={authRoutes.login.path} className="btn-login">Se connecter</Link>
<Link to={authRoutes.login.path} className="btn-login">Sign in</Link>
</div>
</ModalAuth>
);
Expand Down
18 changes: 9 additions & 9 deletions src/pages/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ const Login: React.FC<propsTypes> = ({ loginAction }) => {
};

return (
<ModalAuth title="Connectez-vous à Clone Twitter" loading={loading} disabled={disabled}>
<ModalAuth title="Connect to Twitter Clone" loading={loading} disabled={disabled}>
<div className="box-social-auth">
<GoogleLoginButton text={"Se connecter avec Google"} nameClass="btn-signup-ext btn-signup" />
<GoogleLoginButton text={"Login with Google"} nameClass="btn-signup-ext btn-signup" />
<ButtonCustom
nameClass={"btn-signup-ext"}
pic={"/static/svg/apple.svg"}
text={"Se connecter avec Apple"}
text={"Login with Apple"}
/>
</div>
<div className="sep">
<hr />
<span>ou</span>
<span>or</span>
</div>
<form onSubmit={onSubmit}>
{displayError && (
Expand All @@ -70,19 +70,19 @@ const Login: React.FC<propsTypes> = ({ loginAction }) => {
id="password"
name="password"
type="password"
label="Mot de passe"
label="Password"
onChange={handleChange}
isPasswords={true}
value={password}
/>
<ButtonCustom nameClass={"btn-signup"} text={"Se connecter"} isDisabled={disabled} />
<ButtonCustom nameClass={"btn-signup"} text={"Sign in"} isDisabled={disabled} />
<div className="info">
<h4>
Mot de passe ?<Link to={disabled ? "" : authRoutes.requestResetPassword.path}> Cliquer ici</Link>
Forgot your password?<Link to={disabled ? "" : authRoutes.requestResetPassword.path}> Click here</Link>
</h4>
<h4>
Vous n'avez pas de compte ?
<Link to={disabled ? "" : authRoutes.signup.path}> Inscrivez-vous</Link>
Don't have an account?
<Link to={disabled ? "" : authRoutes.signup.path}> Sign up</Link>
<br />
<br />
</h4>
Expand Down
7 changes: 3 additions & 4 deletions src/pages/auth/RequestResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ const RequestResetPassword: React.FC<propsTypes> = ({ requestResetPasswordAction
};

return (
<ModalAuth title="Réinitialisation du mot de passe" loading={loading} disabled={disabled}>
<ModalAuth title="Request password reset" loading={loading} disabled={disabled}>
<form onSubmit={onSubmit}>
<p>
Mot de passe oublié ? Entrez votre adresse email ci-dessous et si votre adresse email existe, nous
vous enverrons par e-mail des instructions pour en définir une nouvelle.
Forgot your password? Enter your email address below, and if your email address exists, we will send you instructions on how to set a new one.
</p>
<InputCustom
id="email"
Expand All @@ -47,7 +46,7 @@ const RequestResetPassword: React.FC<propsTypes> = ({ requestResetPasswordAction
onChange={handleChange}
value={email}
/>
<ButtonCustom nameClass={"btn-signup"} text={"Envoyer"} isDisabled={disabled} />
<ButtonCustom nameClass={"btn-signup"} text={"Send"} isDisabled={disabled} />
</form>
</ModalAuth>
);
Expand Down
8 changes: 3 additions & 5 deletions src/pages/auth/RequestResetPasswordConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ const RequestResetPasswordConfirm: React.FC = () => {
<ModalAuth>
<div className="info-auth">
<img src="/static/svg/envelope.svg" alt="" />
<h3>Réinitialisation du mot de passe envoyée</h3>
<h3>Password reset sent</h3>
<br />
<p>
Nous vous avons envoyé par email des instructions pour définir votre mot de passe, si un compte
existe avec l'e-mail que vous avez saisi. Vous devriez les recevoir sous peu.
We have sent you an email with instructions to set your password, if an account exists with the email you entered. You should receive it shortly.
</p>
<p>
Si vous ne recevez pas d'e-mail, assurez-vous d'avoir entré l'adresse avec laquelle vous vous êtes
inscrit et vérifiez votre dossier spam.
If you do not receive an email, make sure you entered the address you used to sign up and check your spam folder.
</p>
</div>
</ModalAuth>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/auth/ResetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const ResetPassword: React.FC<propsTypes> = ({ resetPasswordAction }) => {
};

return (
<ModalAuth title="Réinitialisation votre mot de passe" loading={loading} disabled={disabled}>
<ModalAuth title="Reset my password" loading={loading} disabled={disabled}>
<form onSubmit={onSubmit}>
{displayError && (
<div className="error-auth">
Expand All @@ -75,7 +75,7 @@ const ResetPassword: React.FC<propsTypes> = ({ resetPasswordAction }) => {
id="password"
name="password"
type="password"
label="Mot de passe"
label="Password *"
onChange={handleChange}
isPasswords={true}
value={password}
Expand All @@ -84,12 +84,12 @@ const ResetPassword: React.FC<propsTypes> = ({ resetPasswordAction }) => {
id="confirmPassword"
name="confirmPassword"
type="password"
label="Confimer mot de passe *"
label="Confirm Password *"
onChange={handleChange}
isPasswords={true}
value={confirmPassword}
/>
<ButtonCustom nameClass={"btn-signup"} text={"Valider"} isDisabled={disabled} />
<ButtonCustom nameClass={"btn-signup"} text={"Send"} isDisabled={disabled} />
</form>
</ModalAuth>
);
Expand Down
6 changes: 3 additions & 3 deletions src/pages/auth/ResetPasswordConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const ResetPasswordConfirm: React.FC = () => {
<img src="/static/svg/success.svg" alt="" />
<br />
<br />
<h2>Réinitialisation du mot de passe terminée !</h2>
<h2>Password reset complete!</h2>
<br />
<p>Votre mot de passe a été bien défini. Vous pouvez continuer et vous connecter maintenant.</p>
<p>Your password has been set successfully. You can proceed and log in now.</p>
<br />
<Link to={authRoutes.login.path} className="btn-login">Se connecter</Link>
<Link to={authRoutes.login.path} className="btn-login">Sign in</Link>
</div>
</ModalAuth>
);
Expand Down
18 changes: 9 additions & 9 deletions src/pages/auth/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ const SignUp: React.FC<propsTypes> = ({ signupAction }) => {

const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
const checkFirstName = await controlField.blankValidator("Prénom", firstName);
const checkLastName = await controlField.blankValidator("Nom", lastName);
const checkFirstName = await controlField.blankValidator("First Name", firstName);
const checkLastName = await controlField.blankValidator("Last Name", lastName);
const checkEmail = await controlField.emailValidator(email);
const checkPassword = await controlField.passwordValidator(password, confirmPassword);

Expand Down Expand Up @@ -79,7 +79,7 @@ const SignUp: React.FC<propsTypes> = ({ signupAction }) => {
};

return (
<ModalAuth title="Créer votre compte" loading={loading} disabled={disabled}>
<ModalAuth title="Create your account" loading={loading} disabled={disabled}>
<form onSubmit={onSubmit}>
{displayError && (
<div className="error-auth">
Expand All @@ -90,15 +90,15 @@ const SignUp: React.FC<propsTypes> = ({ signupAction }) => {
<InputCustom
id="firstName"
name="firstName"
label="Prénom *"
label="First Name *"
maxLength="50"
onChange={handleChange}
value={firstName}
/>
<InputCustom
id="lastName"
name="lastName"
label="Nom *"
label="Last Name *"
maxLength="50"
onChange={handleChange}
value={lastName}
Expand All @@ -115,7 +115,7 @@ const SignUp: React.FC<propsTypes> = ({ signupAction }) => {
id="password"
name="password"
type="password"
label="Mot de passe *"
label="Password *"
onChange={handleChange}
isPasswords={true}
value={password}
Expand All @@ -124,19 +124,19 @@ const SignUp: React.FC<propsTypes> = ({ signupAction }) => {
id="confirmPassword"
name="confirmPassword"
type="password"
label="Confimer mot de passe *"
label="Confirm Password *"
onChange={handleChange}
isPasswords={true}
value={confirmPassword}
/>
<ButtonCustom
nameClass={disabled ? "btn-signup disabled" : "btn-signup"}
text={"S'inscrire"}
text={"Sign up"}
isDisabled={disabled}
/>
<div className="info">
<h4>
Vous avez déjà un compte ?<Link to={disabled ? "" : authRoutes.login.path}> Connectez-vous</Link>
Already have an account?<Link to={disabled ? "" : authRoutes.login.path}> Sign in</Link>
</h4>
</div>
</form>
Expand Down
8 changes: 3 additions & 5 deletions src/pages/auth/SingUpConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ const SignUpConfirm: React.FC = () => {
<ModalAuth>
<div className="info-auth">
<img src="/static/svg/envelope.svg" alt="envelope" />
<h3>Merci de vous être inscrit à un compte Clone Twitter</h3>
<h3>Thank you for signing up for a Twitter Clone account.</h3>
<br />
<p>Veuillez vérifier votre adresse e-mail afin d'accéder à votre compte Clone Twitter.</p>
<p>Please verify your email address to access your Twitter Clone account.</p>
<p>
Nous avons envoyé un email à <strong>{state as string}</strong> <br /> Pour continuer, veuillez
vérifier votre boîte de réception et vérifier votre adresse e-mail. Si vous n'avez pas reçu l'email,
veuillez vérifier votre dossier spam.
We have sent an email to <strong>{state as string}</strong> <br /> To continue, please check your inbox and verify your email address. If you did not receive the email, please check your spam folder.
</p>
</div>
</ModalAuth>
Expand Down
5 changes: 2 additions & 3 deletions src/pages/error/Error404.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ const Error404: React.FC = () => {
<h2>404</h2>
<h4>Opps! page not found</h4>
<p>
La page que vous recherchez n'existe pas. Il se peut que vous ayez mal saisi l'adresse
ou que la page ait été déplacée.
The page you are looking for does not exist. You may have entered the address incorrectly, or the page may have been moved.
</p>
<Link to="/">
<span>Revenir à la page d'acceuil</span>
<span>Back to home page</span>
</Link>
</div>
</div>
Expand Down
Loading

0 comments on commit ed29933

Please sign in to comment.