fix(i18n): prepare for Lokalise
This commit is contained in:
@@ -2,12 +2,15 @@
|
||||
|
||||
import * as Sentry from "@sentry/nextjs"
|
||||
import { useEffect } from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
export default function Error({
|
||||
error,
|
||||
}: {
|
||||
error: Error & { digest?: string }
|
||||
}) {
|
||||
const intl = useIntl()
|
||||
|
||||
useEffect(() => {
|
||||
if (!error) return
|
||||
|
||||
@@ -18,7 +21,12 @@ export default function Error({
|
||||
return (
|
||||
<p>
|
||||
<strong>
|
||||
Error loading this page ({error.digest}@{Date.now()})
|
||||
{intl.formatMessage(
|
||||
{ id: "Error loading this page ({errorId})" },
|
||||
{
|
||||
errorId: `${error.digest}@${Date.now()}`,
|
||||
}
|
||||
)}
|
||||
</strong>
|
||||
</p>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user