From 1d43edbae2c0597207b290189b639dab181ad9c7 Mon Sep 17 00:00:00 2001 From: "Glenn R. Martin" Date: Wed, 31 May 2023 10:23:39 -0400 Subject: [PATCH] fix: Internationalization of ErrorPage when Cookies aren't available --- src/index.jsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/index.jsx b/src/index.jsx index 0f1570503..20a6e8e98 100755 --- a/src/index.jsx +++ b/src/index.jsx @@ -20,10 +20,12 @@ import ReactDOM from 'react-dom'; import { Route, Switch } from 'react-router-dom'; import { sendTrackEvent } from '@edx/frontend-platform/analytics'; -import { logError } from '@edx/frontend-platform/logging'; +import { getLoggingService, logError } from '@edx/frontend-platform/logging'; import Header, { messages as headerMessages } from '@edx/frontend-component-header'; import Footer, { messages as footerMessages } from '@edx/frontend-component-footer'; +import { configure as configureI18n } from '@edx/frontend-platform/i18n/lib'; +import { getLocale } from '@edx/frontend-platform/i18n'; import appMessages from './i18n'; import { PaymentPage, @@ -101,6 +103,15 @@ subscribe(APP_READY, () => { }); subscribe(APP_INIT_ERROR, (error) => { + try { + getLocale('en'); + } catch (e) { + configureI18n({ + messages: {}, + config: getConfig(), + loggingService: getLoggingService(), + }); + } ReactDOM.render(, document.getElementById('root')); });