Ver Fonte

RHL-022 feat(auth): translate session and branch validation messages to German

Code_Uwe há 1 mês atrás
pai
commit
2c1a11f0aa
2 ficheiros alterados com 7 adições e 15 exclusões
  1. 5 11
      components/auth/AuthProvider.jsx
  2. 2 4
      components/auth/BranchGuard.jsx

+ 5 - 11
components/auth/AuthProvider.jsx

@@ -1,9 +1,3 @@
-// ---------------------------------------------------------------------------
-// Folder: components/auth
-// File: AuthProvider.jsx
-// Relative Path: components/auth/AuthProvider.jsx
-// ---------------------------------------------------------------------------
-
 "use client";
 
 import React from "react";
@@ -99,7 +93,7 @@ export default function AuthProvider({ children }) {
 				setAuth({
 					status: "error",
 					user: null,
-					error: "Unable to verify your session. Please try again.",
+					error: "Sitzung konnte nicht geprüft werden. Bitte erneut versuchen.",
 				});
 			}
 		}
@@ -122,7 +116,7 @@ export default function AuthProvider({ children }) {
 					<div className="mx-auto flex min-h-screen max-w-md items-center justify-center">
 						<div className="flex items-center gap-3 text-sm text-muted-foreground">
 							<Loader2 className="h-4 w-4 animate-spin" />
-							<span>Checking session...</span>
+							<span>Sitzung wird geprüft…</span>
 						</div>
 					</div>
 				</div>
@@ -137,7 +131,7 @@ export default function AuthProvider({ children }) {
 					<div className="mx-auto flex min-h-screen max-w-md items-center justify-center">
 						<div className="w-full space-y-4">
 							<Alert variant="destructive">
-								<AlertTitle>Session check failed</AlertTitle>
+								<AlertTitle>Sitzungsprüfung fehlgeschlagen</AlertTitle>
 								<AlertDescription>{auth.error}</AlertDescription>
 							</Alert>
 
@@ -146,7 +140,7 @@ export default function AuthProvider({ children }) {
 								className="w-full"
 								onClick={() => setRetryTick((n) => n + 1)}
 							>
-								Retry
+								Erneut versuchen
 							</Button>
 						</div>
 					</div>
@@ -163,7 +157,7 @@ export default function AuthProvider({ children }) {
 					<div className="mx-auto flex min-h-screen max-w-md items-center justify-center">
 						<div className="flex items-center gap-3 text-sm text-muted-foreground">
 							<Loader2 className="h-4 w-4 animate-spin" />
-							<span>Redirecting to login...</span>
+							<span>Weiterleitung zum Login…</span>
 						</div>
 					</div>
 				</div>

+ 2 - 4
components/auth/BranchGuard.jsx

@@ -24,7 +24,7 @@ function BranchValidationLoading() {
 	return (
 		<div className="flex items-center gap-3 text-sm text-muted-foreground">
 			<Loader2 className="h-4 w-4 animate-spin" />
-			<span>Validating branch...</span>
+			<span>Niederlassung wird geprüft…</span>
 		</div>
 	);
 }
@@ -73,9 +73,7 @@ export default function BranchGuard({ branch, children }) {
 		// - do NOT depend on branchList.status (would cancel itself when setting LOADING)
 	}, [needsExistenceCheck, user?.userId]);
 
-	if (!isAuthenticated) {
-		return children;
-	}
+	if (!isAuthenticated) return children;
 
 	if (needsExistenceCheck && branchList.status === BRANCH_LIST_STATE.LOADING) {
 		return <BranchValidationLoading />;