fixed translation bug

This commit is contained in:
2026-02-09 13:42:19 +01:00
parent d05e9ab3ee
commit 757b316b49
3 changed files with 8 additions and 4 deletions

View File

@@ -1,10 +1,13 @@
import Cookies from "js-cookie";
import { API_BASE } from "@/config/api.config";
import { useTranslation } from "react-i18next";
export const getBorrowableItems = async (
startDate: string,
endDate: string
endDate: string,
) => {
const { t } = useTranslation();
try {
const response = await fetch(`${API_BASE}/api/loans/borrowable-items`, {
method: "POST",
@@ -21,8 +24,7 @@ export const getBorrowableItems = async (
data: null,
status: "error",
title: "Server error",
description:
"Ein Fehler ist auf dem Server aufgetreten. Manchmal hilft es, die Seite neu zu laden.",
description: t("serverError"),
};
}
@@ -48,7 +50,7 @@ export const createLoan = async (
itemIds: number[],
startDate: string,
endDate: string,
note: string | null
note: string | null,
) => {
const response = await fetch(`${API_BASE}/api/loans/createLoan`, {
method: "POST",

View File

@@ -84,6 +84,7 @@
"contact": "Kontakt",
"take": "Abholen",
"return": "Zurückgeben",
"serverError": "Serverfehler. Bitte versuchen Sie es später erneut, oder laden Sie die Seite neu.",
"take-loan-success": "Ausleihe erfolgreich abgeholt",
"return-loan-success": "Ausleihe erfolgreich zurückgegeben",
"network-error": "Netzwerkfehler. Kontaktieren Sie den Administrator.",

View File

@@ -82,6 +82,7 @@
"contactPage_messagePlaceholder": "Enter your message here...",
"contactPage_messageErrorText": "This field cannot be empty.",
"contact": "Contact",
"serverError": "Server error. Please try again later, or refresh the page.",
"take": "Take",
"return": "Return",
"take-loan-success": "Loan taken successfully",