mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 08:32:39 +00:00
i18n, finally
This commit is contained in:
@@ -173,6 +173,7 @@
|
||||
"error": {
|
||||
"unknownContext": "Der Kontext des Benutzers konnte nicht ermittelt werden. Stellen Sie sicher, dass Sie zuerst den Benutzernamen eingeben oder einen loginName als Suchparameter angeben.",
|
||||
"sessionExpired": "Ihre aktuelle Sitzung ist abgelaufen. Bitte melden Sie sich erneut an.",
|
||||
"failedLoading": "Daten konnten nicht geladen werden. Bitte versuchen Sie es erneut."
|
||||
"failedLoading": "Daten konnten nicht geladen werden. Bitte versuchen Sie es erneut.",
|
||||
"tryagain": "Erneut versuchen"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@
|
||||
"error": {
|
||||
"unknownContext": "Could not get the context of the user. Make sure to enter the username first or provide a loginName as searchParam.",
|
||||
"sessionExpired": "Your current session has expired. Please login again.",
|
||||
"failedLoading": "Failed to load data. Please try again."
|
||||
"failedLoading": "Failed to load data. Please try again.",
|
||||
"tryagain": "Try Again"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@
|
||||
"error": {
|
||||
"unknownContext": "No se pudo obtener el contexto del usuario. Asegúrate de ingresar primero el nombre de usuario o proporcionar un loginName como parámetro de búsqueda.",
|
||||
"sessionExpired": "Tu sesión actual ha expirado. Por favor, inicia sesión de nuevo.",
|
||||
"failedLoading": "No se pudieron cargar los datos. Por favor, inténtalo de nuevo."
|
||||
"failedLoading": "No se pudieron cargar los datos. Por favor, inténtalo de nuevo.",
|
||||
"tryagain": "Intentar de nuevo"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@
|
||||
"error": {
|
||||
"unknownContext": "Impossibile ottenere il contesto dell'utente. Assicurati di inserire prima il nome utente o di fornire un loginName come parametro di ricerca.",
|
||||
"sessionExpired": "La tua sessione attuale è scaduta. Effettua nuovamente l'accesso.",
|
||||
"failedLoading": "Impossibile caricare i dati. Riprova."
|
||||
"failedLoading": "Impossibile caricare i dati. Riprova.",
|
||||
"tryagain": "Riprova"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { Boundary } from "@/components/boundary";
|
||||
import { Button } from "@/components/button";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { useEffect } from "react";
|
||||
|
||||
export default function Error({ error, reset }: any) {
|
||||
@@ -9,6 +10,8 @@ export default function Error({ error, reset }: any) {
|
||||
console.log("logging error:", error);
|
||||
}, [error]);
|
||||
|
||||
const t = useTranslations("error");
|
||||
|
||||
return (
|
||||
<Boundary labels={["Login Error"]} color="red">
|
||||
<div className="space-y-4">
|
||||
@@ -16,7 +19,7 @@ export default function Error({ error, reset }: any) {
|
||||
<strong className="font-bold">Error:</strong> {error?.message}
|
||||
</div>
|
||||
<div>
|
||||
<Button onClick={() => reset()}>Try Again</Button>
|
||||
<Button onClick={() => reset()}>{t("tryagain")}</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Boundary>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { Boundary } from "@/components/boundary";
|
||||
import { Button } from "@/components/button";
|
||||
import { ThemeWrapper } from "@/components/theme-wrapper";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
export default function GlobalError({
|
||||
error,
|
||||
@@ -11,6 +12,8 @@ export default function GlobalError({
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
const t = useTranslations("error");
|
||||
|
||||
return (
|
||||
// global-error must include html and body tags
|
||||
<html>
|
||||
@@ -22,7 +25,7 @@ export default function GlobalError({
|
||||
<span className="font-bold">Error:</span> {error?.message}
|
||||
</div>
|
||||
<div>
|
||||
<Button onClick={() => reset()}>Try Again</Button>
|
||||
<Button onClick={() => reset()}>{t("tryagain")}</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Boundary>
|
||||
|
||||
@@ -67,20 +67,20 @@ export function RegisterFormWithoutPassword({
|
||||
lastName: values.lastname,
|
||||
organization: organization,
|
||||
authRequestId: authRequestId,
|
||||
}).catch((error) => {
|
||||
setError("Could not register user");
|
||||
setLoading(false);
|
||||
return;
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
setError("Could not register user");
|
||||
return;
|
||||
})
|
||||
.finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
|
||||
if (response && "error" in response) {
|
||||
setError(response.error);
|
||||
setLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
setLoading(false);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user