- Bump frontend-platform to bring intl-imports.js script - Move all i18n imports into `src/i18n/index.js` so intl-imports.js can override it with latest translations - Add `atlas` into `make pull_translations` when `OPENEDX_ATLAS_PULL` environment variable is set. This pull request is part of the [FC-0012 project](https://openedx.atlassian.net/l/cp/XGS0iCcQ) which is sparked by the [Translation Infrastructure update OEP-58](https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0058-arch-translations-management.html#specification).
64 lines
1.3 KiB
JavaScript
Executable File
64 lines
1.3 KiB
JavaScript
Executable File
/* eslint-disable import/prefer-default-export */
|
|
import 'core-js/stable';
|
|
import 'regenerator-runtime/runtime';
|
|
|
|
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import { Switch, Redirect } from 'react-router-dom';
|
|
|
|
import {
|
|
AppProvider,
|
|
ErrorPage,
|
|
PageRoute,
|
|
} from '@edx/frontend-platform/react';
|
|
import store from 'data/store';
|
|
import {
|
|
APP_READY,
|
|
APP_INIT_ERROR,
|
|
initialize,
|
|
subscribe,
|
|
mergeConfig,
|
|
} from '@edx/frontend-platform';
|
|
|
|
import { configuration } from './config';
|
|
|
|
import messages from './i18n';
|
|
|
|
import App from './App';
|
|
import NoticesWrapper from './components/NoticesWrapper';
|
|
|
|
subscribe(APP_READY, () => {
|
|
ReactDOM.render(
|
|
<AppProvider store={store}>
|
|
<NoticesWrapper>
|
|
<Switch>
|
|
<PageRoute path="/">
|
|
<App />
|
|
</PageRoute>
|
|
<Redirect to="/" />
|
|
</Switch>
|
|
</NoticesWrapper>
|
|
</AppProvider>,
|
|
document.getElementById('root'),
|
|
);
|
|
});
|
|
|
|
subscribe(APP_INIT_ERROR, (error) => {
|
|
ReactDOM.render(
|
|
<ErrorPage message={error.message} />,
|
|
document.getElementById('root'),
|
|
);
|
|
});
|
|
|
|
export const appName = 'LearnerHomeAppConfig';
|
|
|
|
initialize({
|
|
handlers: {
|
|
config: () => {
|
|
mergeConfig(configuration, appName);
|
|
},
|
|
},
|
|
messages,
|
|
requireAuthenticatedUser: true,
|
|
});
|