change usage of t to msg
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import React, {Component, ErrorInfo, ReactNode} from 'react'
|
||||
import {ErrorScreen} from './error/ErrorScreen'
|
||||
import {CenteredView} from './Views'
|
||||
import {t} from '@lingui/macro'
|
||||
import {msg} from '@lingui/macro'
|
||||
import {logger} from '#/logger'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
interface Props {
|
||||
children?: ReactNode
|
||||
@@ -31,11 +32,7 @@ export class ErrorBoundary extends Component<Props, State> {
|
||||
if (this.state.hasError) {
|
||||
return (
|
||||
<CenteredView style={{height: '100%', flex: 1}}>
|
||||
<ErrorScreen
|
||||
title={t`Oh no!`}
|
||||
message={t`There was an unexpected issue in the application. Please let us know if this happened to you!`}
|
||||
details={this.state.error.toString()}
|
||||
/>
|
||||
<TranslatedErrorScreen details={this.state.error.toString()} />
|
||||
</CenteredView>
|
||||
)
|
||||
}
|
||||
@@ -43,3 +40,17 @@ export class ErrorBoundary extends Component<Props, State> {
|
||||
return this.props.children
|
||||
}
|
||||
}
|
||||
|
||||
function TranslatedErrorScreen({details}: {details?: string}) {
|
||||
const {_} = useLingui()
|
||||
|
||||
return (
|
||||
<ErrorScreen
|
||||
title={_(msg`Oh no!`)}
|
||||
message={_(
|
||||
msg`There was an unexpected issue in the application. Please let us know if this happened to you!`,
|
||||
)}
|
||||
details={details}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user