Internationalize ErrorBoundary

This commit is contained in:
schroda
2025-03-28 18:47:29 +01:00
parent 07a44ed02b
commit 99f14e2f27
3 changed files with 14 additions and 5 deletions

View File

@@ -8,7 +8,9 @@
import { Component, ErrorInfo, ReactNode, useEffect, useRef, useState } from 'react';
import { useLocation } from 'react-router-dom';
import { t } from 'i18next';
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
import { EmptyView } from '@/modules/core/components/placeholder/EmptyView.tsx';
interface Props {
children?: ReactNode;
@@ -54,10 +56,11 @@ class RealErrorBoundary extends Component<Props, State> {
if (error) {
return (
<>
<h1>Something went wrong.</h1>
<p>{getErrorMessage(error)}</p>
</>
<EmptyView
message={t('global.error.label.unrecoverable_error')}
messageExtra={getErrorMessage(error)}
retry={() => window.location.reload()}
/>
);
}