mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-16 22:38:20 +00:00
feat(i18n): add localization infrastructure and English catalog
Refs #17
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Component, ErrorInfo, ReactNode } from 'react';
|
||||
import i18n from '../i18n';
|
||||
|
||||
interface Props {
|
||||
children: ReactNode;
|
||||
@@ -38,10 +39,10 @@ export class ErrorBoundary extends Component<Props, State> {
|
||||
<svg className="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
|
||||
</svg>
|
||||
<h1 className="text-xl font-bold">Something went wrong.</h1>
|
||||
<h1 className="text-xl font-bold">{i18n.t($ => $.dialogs.errorBoundary.title)}</h1>
|
||||
</div>
|
||||
<div className="text-sm text-text-secondary mb-6">
|
||||
A critical error occurred in the React component tree. The error details below can help identify the root cause.
|
||||
{i18n.t($ => $.dialogs.errorBoundary.description)}
|
||||
</div>
|
||||
<div className="bg-black/50 p-4 rounded text-xs font-mono text-red-300 overflow-x-auto mb-4">
|
||||
{this.state.error && this.state.error.toString()}
|
||||
@@ -52,7 +53,7 @@ export class ErrorBoundary extends Component<Props, State> {
|
||||
className="app-button px-4 py-2 bg-red-600/20 text-red-400 border border-red-600/50 hover:bg-red-600/30 transition-colors rounded"
|
||||
onClick={() => window.location.reload()}
|
||||
>
|
||||
Reload App
|
||||
{i18n.t($ => $.dialogs.errorBoundary.reload)}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user