2021-12-28 10:56:23 +00:00
|
|
|
import { I18nProvider } from '@react-aria/i18n'
|
2022-11-03 16:32:04 +00:00
|
|
|
import { withProfiler } from '@sentry/react'
|
2022-11-23 17:07:01 +00:00
|
|
|
import { createRoot } from 'react-dom/client'
|
2022-11-03 16:32:04 +00:00
|
|
|
|
2021-03-23 09:09:10 +00:00
|
|
|
import App from './App'
|
2021-01-18 13:34:27 +00:00
|
|
|
import i18next from './locales/i18n'
|
|
|
|
import ruleTranslations from './locales/rules-en.yaml'
|
|
|
|
import translateRules from './locales/translateRules'
|
2021-03-23 09:09:10 +00:00
|
|
|
import translations from './locales/ui-en.yaml'
|
2022-11-03 16:32:04 +00:00
|
|
|
|
2021-05-03 11:28:31 +00:00
|
|
|
import './sentry'
|
2018-08-28 13:59:41 +00:00
|
|
|
|
2021-12-29 17:21:02 +00:00
|
|
|
export const AppEn = () => (
|
2021-11-30 15:09:05 +00:00
|
|
|
<I18nProvider locale="en-GB">
|
2021-12-27 11:46:40 +00:00
|
|
|
<App
|
|
|
|
basename="infrance"
|
2022-01-04 10:11:31 +00:00
|
|
|
rulesPreTransform={(rules) =>
|
|
|
|
translateRules('en', ruleTranslations, rules)
|
|
|
|
}
|
2021-12-27 11:46:40 +00:00
|
|
|
/>
|
2021-12-28 10:56:23 +00:00
|
|
|
</I18nProvider>
|
2021-11-30 15:09:05 +00:00
|
|
|
)
|
2021-12-28 10:56:23 +00:00
|
|
|
|
2022-04-13 16:42:50 +00:00
|
|
|
const AppEnWithProfiler = withProfiler(AppEn)
|
|
|
|
|
2021-12-29 17:21:02 +00:00
|
|
|
i18next.addResourceBundle('en', 'translation', translations)
|
|
|
|
|
|
|
|
if (!import.meta.env.SSR) {
|
2022-03-28 13:34:12 +00:00
|
|
|
i18next.changeLanguage('en').catch((err) =>
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.error(err)
|
|
|
|
)
|
2022-11-23 17:07:01 +00:00
|
|
|
|
|
|
|
const container = document.querySelector('#js') as Element
|
|
|
|
const root = createRoot(container)
|
|
|
|
root.render(<AppEnWithProfiler />)
|
2021-12-29 17:21:02 +00:00
|
|
|
}
|