Skip to content

Commit

Permalink
feat: add text variables to the page
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengShi-1 committed Oct 4, 2024
1 parent b2159f4 commit dd21944
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions public/locales/en/errorPage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"message": {
"heading": "Oops,",
"errorText": "something went wrong..."
},
"brandName": "Dataverse",
"backToHomepage": "Back to {{brandName}} Homepage"
}
8 changes: 4 additions & 4 deletions src/sections/error-page/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ExclamationCircle } from 'react-bootstrap-icons'
import { useTheme } from '@iqss/dataverse-design-system'

export function ErrorPage() {
const { t } = useTranslation('ErrorPage')
const { t } = useTranslation('errorPage')
const error = useRouteError()
useErrorLogger(error)
const theme = useTheme()
Expand All @@ -17,13 +17,13 @@ export function ErrorPage() {
<div className={styles['icon-layout']}>
<ExclamationCircle color={theme.color.dangerColor} size={62} />
<div aria-label="error-page">
<h1>Oops,</h1>
<h4>something went wrong...</h4>
<h1>{t('message.heading')}</h1>
<h4>{t('message.errorText')}</h4>
</div>
</div>

<Link to="/" className="btn btn-secondary">
{t('Back to Dataverse Homepage')}
{t('backToHomepage', { brandName: t('brandName') })}
</Link>
</div>
</section>
Expand Down

0 comments on commit dd21944

Please sign in to comment.