feat: add authorization

This commit is contained in:
2026-08-13 15:03:59 +03:00
parent 1e13adabd3
commit 3448fea140
28 changed files with 4504 additions and 3707 deletions
+1
View File
@@ -10,4 +10,5 @@ void i18n.use(initReactI18next).init({
interpolation: { escapeValue: false },
});
export { validationMessage } from "./zod";
export { i18n };
+16 -1
View File
@@ -2,7 +2,22 @@ export const ru = {
translation: {
appName: "WealthLedger",
navigation: { accounts: "Счета", settings: "Настройки" },
auth: { login: "Вход", register: "Регистрация" },
auth: {
login: "Вход",
register: "Регистрация",
email: "Email",
password: "Пароль",
passwordConfirmation: "Подтвердите пароль",
noAccount: "Нет аккаунта? Зарегистрироваться",
haveAccount: "Уже есть аккаунт? Войти",
requestError: "Не удалось выполнить запрос. Попробуйте ещё раз.",
logout: "Выйти",
validation: {
invalidEmail: "Некорректный email",
invalidPasswordLength: "Пароль должен содержать от 12 до 72 байт",
passwordsDoNotMatch: "Пароли не совпадают",
},
},
accounts: { title: "Счета" },
account: { title: "Счет" },
settings: { title: "Настройки" },
+9
View File
@@ -0,0 +1,9 @@
import type { ParseKeys } from "i18next";
import { i18n } from ".";
export function validationMessage(
key: ParseKeys,
): (_value: unknown) => { message: string } {
return () => ({ message: i18n.t(key) });
}