Skip to content

Commit cad5adc

Browse files
committed
Русифицируем
1 parent ba1706b commit cad5adc

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ STACK_NAME=full-stack-fastapi-project
1818

1919
# Backend
2020
BACKEND_CORS_ORIGINS="http://localhost,http://localhost:5173,https://localhost,https://localhost:5173,http://localhost.tiangolo.com"
21-
SECRET_KEY=changethis
21+
SECRET_KEY=123
2222
FIRST_SUPERUSER=[email protected]
23-
FIRST_SUPERUSER_PASSWORD=changethis
23+
FIRST_SUPERUSER_PASSWORD=123
2424

2525
# Emails
2626
SMTP_HOST=

frontend/src/routes/_layout/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ function Dashboard() {
1515
<Container maxW="full">
1616
<Box pt={12} m={4}>
1717
<Text fontSize="2xl">
18-
Hi, {currentUser?.full_name || currentUser?.email} 👋🏼
18+
Привет, {currentUser?.full_name || currentUser?.email} 👋🏼
1919
</Text>
20-
<Text>Welcome back, nice to see you again!</Text>
20+
<Text>Добро пожаловать обратно, приятно видеть вас снова!</Text>
2121
</Box>
2222
</Container>
2323
</>

frontend/src/routes/signup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ function SignUp() {
147147
)}
148148
</FormControl>
149149
<Button variant="primary" type="submit" isLoading={isSubmitting}>
150-
Sign Up
150+
Выйти
151151
</Button>
152152
<Text>
153153
Already have an account?{" "}
154154
<Link as={RouterLink} to="/login" color="blue.500">
155-
Log In
155+
Вход
156156
</Link>
157157
</Text>
158158
</Container>

frontend/src/utils.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ import type { ApiError } from "./client"
22

33
export const emailPattern = {
44
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
5-
message: "Invalid email address",
5+
message: "Неверный email address",
66
}
77

88
export const namePattern = {
99
value: /^[A-Za-z\s\u00C0-\u017F]{1,30}$/,
10-
message: "Invalid name",
10+
message: "Неверное имя",
1111
}
1212

1313
export const passwordRules = (isRequired = true) => {
1414
const rules: any = {
1515
minLength: {
1616
value: 8,
17-
message: "Password must be at least 8 characters",
17+
message: "Пароль должен содердать 8 символов",
1818
},
1919
}
2020

2121
if (isRequired) {
22-
rules.required = "Password is required"
22+
rules.required = "Требуется ввести пароль"
2323
}
2424

2525
return rules
@@ -32,22 +32,22 @@ export const confirmPasswordRules = (
3232
const rules: any = {
3333
validate: (value: string) => {
3434
const password = getValues().password || getValues().new_password
35-
return value === password ? true : "The passwords do not match"
35+
return value === password ? true : "Пароли не совпадают"
3636
},
3737
}
3838

3939
if (isRequired) {
40-
rules.required = "Password confirmation is required"
40+
rules.required = "Требуется подтверждение пароля"
4141
}
4242

4343
return rules
4444
}
4545

4646
export const handleError = (err: ApiError, showToast: any) => {
4747
const errDetail = (err.body as any)?.detail
48-
let errorMessage = errDetail || "Something went wrong."
48+
let errorMessage = errDetail || "Что-то пошло не так."
4949
if (Array.isArray(errDetail) && errDetail.length > 0) {
5050
errorMessage = errDetail[0].msg
5151
}
52-
showToast("Error", errorMessage, "error")
52+
showToast("Error", errorMessage, "ошибка")
5353
}

0 commit comments

Comments
 (0)