Skip to content

Commit

Permalink
feat(projects): add il18 for error boundary component
Browse files Browse the repository at this point in the history
  • Loading branch information
mufeng889 committed Aug 8, 2024
1 parent 1e4a109 commit 8d6cc79
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const ErrorPage = () => {
onClick={handleRetry}
type="primary"
>
重新渲染
{t('system.reload')}
</Button>
<Title
className="m-0"
level={5}
>
你的错误是
{t('system.errorReason')}
</Title>
<Text code>{error.message}</Text>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/locales/langs/en-us/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import form from './form';

const local: App.I18n.Schema['translation'] = {
system: {
title: 'SoybeanAdmin'
title: 'SoybeanAdmin',
reload: 'Reload Page',
errorReason: 'Cause Error'
},
common,
route,
Expand Down
4 changes: 3 additions & 1 deletion src/locales/langs/zh-cn/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import page from './page';

const local: App.I18n.Schema['translation'] = {
system: {
title: 'Soybean 管理系统'
title: 'Soybean 管理系统',
reload: '重新渲染页面',
errorReason: '错误原因'
},
common,
request: {
Expand Down
2 changes: 2 additions & 0 deletions src/types/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ declare namespace App {
translation: {
system: {
title: string;
reload: string;
errorReason: string;
};
common: {
action: string;
Expand Down

0 comments on commit 8d6cc79

Please sign in to comment.