Merge pull request #334 from S33G/i18n/unexpected-error

Make unexpected error localizable
This commit is contained in:
wenjie
2025-02-20 17:01:44 +08:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import { Button } from 'antd';
import { t } from 'i18next';
export const MainError = () => {
return (
@@ -7,10 +8,10 @@ export const MainError = () => {
role="alert"
>
<h2 className="text-lg font-semibold text-red-500">
Sorry, there seems to be some problems :(
{t('error.title')}
</h2>
<Button type="primary" danger onClick={() => window.location.assign(window.location.origin)}>
Refresh
{t('error.refresh')}
</Button>
</div>
);

View File

@@ -254,6 +254,10 @@ const en = {
updateBtn: 'Change',
logoutBtn: 'Logout'
}
},
error: {
title: 'We\'ve ran into an issue',
refresh: 'Refresh',
}
}
};