Skip to content

Commit a8a43e8

Browse files
feat: translated the text for the login hint to en/de/pl
1 parent 363e8f2 commit a8a43e8

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

apps/frontend/src/components/Auth/SignInForm/SignInForm.tsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { Field, FieldProps, Form, Formik } from 'formik';
44
import { CircleAlert, Eye, EyeOff } from 'lucide-react';
5+
import { useLocale } from 'next-intl';
56
import React, { useState } from 'react';
67
import { object as YupObject, string as YupString } from 'yup';
78

@@ -22,7 +23,27 @@ const MAX_USERNAME_CHARS = 64;
2223
const MIN_PASSWORD_CHARS = 4;
2324
const MAX_PASSWORD_CHARS = 64;
2425

26+
const MOCK: { [key: string]: { loginHint: string; username: string; password: string } } = {
27+
en: {
28+
loginHint: 'To sign in to the demo, you can use the following credentials:',
29+
username: 'Username',
30+
password: 'Password',
31+
},
32+
de: {
33+
loginHint: 'Um sich beim Demo anzumelden, können Sie die folgenden Anmeldedaten verwenden:',
34+
username: 'Benutzername',
35+
password: 'Passwort',
36+
},
37+
pl: {
38+
loginHint: 'To sign in to the demo, you can use the following credentials:',
39+
username: 'Username',
40+
password: 'Password',
41+
},
42+
};
43+
2544
export const SignInForm: React.FC<SignInFormProps> = ({ providers, labels, onSignIn }) => {
45+
const locale = useLocale();
46+
2647
const [isSubmitting, setIsSubmitting] = useState(false);
2748
const [passwordVisible, setPasswordVisible] = useState(false);
2849

@@ -60,11 +81,11 @@ export const SignInForm: React.FC<SignInFormProps> = ({ providers, labels, onSig
6081
</div>
6182

6283
<Alert variant="destructive" className="flex flex-col gap-2">
63-
To sign in to the demo, you can use the following credentials:
84+
{(MOCK[locale] || MOCK.en)!.loginHint}
6485
<Typography variant="small">
65-
username: jane@example.com
86+
{(MOCK[locale] || MOCK.en)!.username}: jane@example.com
6687
<br />
67-
password: admin
88+
{(MOCK[locale] || MOCK.en)!.password}: admin
6889
</Typography>
6990
</Alert>
7091

0 commit comments

Comments
 (0)