Commit 972a6506 authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

fix: do not double-report i18n exception (#6308)

parent 39a212f7
import { i18n } from '@lingui/core'
import { I18nProvider } from '@lingui/react'
import * as Sentry from '@sentry/react'
import { DEFAULT_LOCALE, SupportedLocale } from 'constants/locales'
import {
af,
......@@ -83,9 +82,8 @@ export async function dynamicActivate(locale: SupportedLocale) {
const catalog = await import(`locales/${locale}.js`)
// Bundlers will either export it as default or as a named export named default.
i18n.load(locale, catalog.messages || catalog.default.messages)
} catch (error) {
console.error(error)
Sentry.captureException(new Error(`Unable to load locale (${locale})`))
} catch (error: unknown) {
console.error(new Error(`Unable to load locale (${locale}): ${error}`))
}
i18n.activate(locale)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment