added english language

This commit is contained in:
SlimusMinus
2026-07-09 00:09:45 +03:00
parent 3b503623f6
commit fffcdaa526
33 changed files with 454 additions and 687 deletions

View File

@@ -10,7 +10,7 @@ export function useAuth() {
const [error, setError] = useState("");
const login = async (login, password) => {
if (!login || !password) { setError("Введите логин и пароль"); return; }
if (!login || !password) { setError("Enter login and password"); return; }
setLoading(true); setError("");
try {
@@ -22,7 +22,7 @@ export function useAuth() {
if (!res.ok) {
const data = await res.json().catch(() => ({}));
throw new Error(data.message || "Неверный логин или пароль");
throw new Error(data.message || "Invalid login or password");
}
const { token, user } = await res.json();

View File

@@ -25,7 +25,7 @@ export function useCreatePost() {
const data = await res.json(); // ← объявляем ПОСЛЕ await res
if (!res.ok) {
throw new Error(data.message || "Ошибка при создании объявления");
throw new Error(data.message || "Error creating ad");
}
setSuccess(true);

View File

@@ -21,7 +21,7 @@ export function useDeleteChat() {
}
return true;
} catch (err) {
setError(err.message || "Не удалось удалить чат");
setError(err.message || "Failed to delete chat");
return false;
} finally {
setLoading(false);

View File

@@ -36,11 +36,11 @@ export function useImageUpload(existingUrls = []) {
for (const file of files) {
if (!file.type.startsWith("image/")) {
setImgError("Только изображения (JPEG, PNG, WebP)");
setImgError("Images only (JPEG, PNG, WebP)");
return;
}
if (file.size > MAX_SIZE_MB * 1024 * 1024) {
setImgError(`Файл слишком большой — максимум ${MAX_SIZE_MB} МБ`);
setImgError(`File too large — max ${MAX_SIZE_MB} MB`);
return;
}
}
@@ -57,7 +57,7 @@ export function useImageUpload(existingUrls = []) {
}));
setImages(prev => [...prev, ...newImages]);
} catch {
setImgError("Не удалось обработать изображение");
setImgError("Failed to process image");
} finally {
setCompressing(false);
if (fileInputRef.current) fileInputRef.current.value = "";

View File

@@ -22,7 +22,7 @@ export function useUpdatePost() {
if (!res.ok) throw new Error(`Ошибка ${res.status}`);
return await res.json();
} catch (err) {
setError(err.message || "Не удалось сохранить");
setError(err.message || "Failed to save");
return null;
} finally {
setLoading(false);

View File

@@ -46,7 +46,7 @@ export function useUpdateProfile() {
const updatedUser = await res.json();
return updatedUser;
} catch (err) {
setError(err.message || "Не удалось сохранить профиль");
setError(err.message || "Failed to save profile");
return null;
} finally {
setLoading(false);